Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Package and Publish
name: Package and Publish to PyPi

on:
release:
Expand Down Expand Up @@ -36,14 +36,19 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Test with pytest
- name: Run unit tests
shell: bash -l {0}
run: |
pytest --cov=chartlets
pytest --cov=chartlets --cov-report=xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
directory: chartlets.py/
flags: backend
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}

PyPi-Deploy:
name: Publish Python Package to PyPI
Expand Down Expand Up @@ -77,57 +82,3 @@ jobs:
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: chartlets.py/dist
verbose: true

npm-tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
# See supported Node.js release schedule at
# https://nodejs.org/en/about/releases/
defaults:
run:
working-directory: chartlets.js

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: chartlets.js/package-lock.json

- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm run test

npm-Deploy:
name: Publish TS-React Package to npmjs
runs-on: ubuntu-latest
needs: npm-tests
defaults:
run:
working-directory: chartlets.js

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
cache-dependency-path: chartlets.js/package-lock.json

- run: npm ci
- run: |
cd packages/lib
npm run build
- run: |
cd packages/lib
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
92 changes: 92 additions & 0 deletions .github/workflows/publish-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Package and Publish to NPM

on:
release:
types: [published]
workflow_dispatch:

jobs:
npm-tests-lib:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
# See supported Node.js release schedule at
# https://nodejs.org/en/about/releases/
defaults:
run:
working-directory: chartlets.js/packages/lib

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: chartlets.js/package-lock.json

- run: npm ci
- run: npm run lint
- run: npm run test

- run: npm run coverage
- name: Upload coverage reports for lib to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
directory: coverage/
flags: frontend
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}

- run: npm run build

npm-tests-demo:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
# See supported Node.js release schedule at
# https://nodejs.org/en/about/releases/
defaults:
run:
working-directory: chartlets.js/packages/demo

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: chartlets.js/package-lock.json

- run: npm ci
- run: npm run lint
- run: npm run build

npm-deploy:
name: Publish TS-React Package to npmjs
runs-on: ubuntu-latest
needs: [npm-tests-lib, npm-tests-demo]
defaults:
run:
working-directory: chartlets.js/packages/lib

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
cache-dependency-path: chartlets.js/package-lock.json

- run: npm ci
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading