Skip to content

Commit 70e560d

Browse files
b-yogeshforman
andauthored
Update CI (#94)
* Update backend-ci.yml * Update publish-frontend.yml * Update publish-backend.yml * Update frontend-ci.yml * revert publish-frontend.yml * Update .github/workflows/publish-backend.yml Co-authored-by: Norman Fomferra <[email protected]> --------- Co-authored-by: Norman Fomferra <[email protected]>
1 parent 5957305 commit 70e560d

File tree

3 files changed

+103
-80
lines changed

3 files changed

+103
-80
lines changed

.github/workflows/backend-ci.yml

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,46 @@ on:
1111
- chartlets.py/**
1212

1313
jobs:
14-
backend:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: git-checkout chartlets
18-
uses: actions/checkout@v4
19-
20-
- name: Set up Micromamba
21-
uses: mamba-org/setup-micromamba@v1
22-
with:
23-
environment-file: chartlets.py/environment.yml
24-
25-
- name: Run unit tests
26-
shell: bash -l {0}
27-
run: |
28-
cd chartlets.py
29-
pytest --cov=chartlets --cov-report=xml
14+
python-tests:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.10", "3.11", "3.12", "3.13"]
20+
defaults:
21+
run:
22+
working-directory: chartlets.py
3023

31-
- name: Upload coverage reports to Codecov
32-
uses: codecov/codecov-action@v4
33-
with:
34-
fail_ci_if_error: true
35-
directory: chartlets.py/
36-
flags: backend
37-
verbose: true
38-
token: ${{ secrets.CODECOV_TOKEN }}
24+
steps:
25+
- uses: actions/checkout@v3
26+
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v3
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install .[dev,demo]
36+
37+
- name: Lint with flake8
38+
run: |
39+
# stop the build if there are Python syntax errors or undefined names
40+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
41+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
42+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
43+
44+
- name: Run unit tests
45+
shell: bash -l {0}
46+
run: |
47+
pytest --cov=chartlets --cov-report=xml
48+
49+
- name: Upload coverage reports to Codecov
50+
uses: codecov/codecov-action@v4
51+
with:
52+
fail_ci_if_error: true
53+
directory: chartlets.py/
54+
flags: backend
55+
verbose: true
56+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/frontend-ci.yml

Lines changed: 60 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,58 +10,63 @@ on:
1010
paths:
1111
- chartlets.js/**
1212

13-
jobs:
14-
frontend:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: git-checkout chartlets
18-
uses: actions/checkout@v4
19-
20-
- name: Set up Node.js
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: '18.x'
24-
25-
- name: Install common dependencies
26-
run: |
27-
cd chartlets.js
28-
npm install
29-
30-
- name: Lib lint
31-
run: |
32-
cd chartlets.js/packages/lib
33-
npm run lint
34-
35-
- name: Lib tests
36-
run: |
37-
cd chartlets.js/packages/lib
38-
npm run test
39-
40-
- name: Lib coverage
41-
run: |
42-
cd chartlets.js/packages/lib
43-
npm run coverage
44-
45-
- name: Upload coverage reports for lib to Codecov
46-
uses: codecov/codecov-action@v4
47-
with:
48-
fail_ci_if_error: true
49-
directory: chartlets.js/packages/lib/coverage/
50-
flags: frontend
51-
verbose: true
52-
token: ${{ secrets.CODECOV_TOKEN }}
53-
54-
- name: Lib build
55-
run: |
56-
cd chartlets.js/packages/lib
57-
npm run build
58-
59-
- name: Demo lint
60-
run: |
61-
cd chartlets.js/packages/demo
62-
npm run lint
63-
64-
- name: Demo build
65-
run: |
66-
cd chartlets.js/packages/demo
67-
npm run build
13+
jobs:
14+
npm-tests-lib:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
node-version: [16.x, 18.x, 20.x]
19+
# See supported Node.js release schedule at
20+
# https://nodejs.org/en/about/releases/
21+
defaults:
22+
run:
23+
working-directory: chartlets.js/packages/lib
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: Use Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
cache: 'npm'
32+
cache-dependency-path: chartlets.js/package-lock.json
33+
34+
- run: npm ci
35+
- run: npm run lint
36+
- run: npm run test
37+
38+
- run: npm run coverage
39+
- name: Upload coverage reports for lib to Codecov
40+
uses: codecov/codecov-action@v4
41+
with:
42+
fail_ci_if_error: true
43+
directory: coverage/
44+
flags: frontend
45+
verbose: true
46+
token: ${{ secrets.CODECOV_TOKEN }}
47+
48+
- run: npm run build
49+
50+
npm-tests-demo:
51+
runs-on: ubuntu-latest
52+
strategy:
53+
matrix:
54+
node-version: [16.x, 18.x, 20.x]
55+
# See supported Node.js release schedule at
56+
# https://nodejs.org/en/about/releases/
57+
defaults:
58+
run:
59+
working-directory: chartlets.js/packages/demo
60+
61+
steps:
62+
- uses: actions/checkout@v3
63+
- name: Use Node.js ${{ matrix.node-version }}
64+
uses: actions/setup-node@v3
65+
with:
66+
node-version: ${{ matrix.node-version }}
67+
cache: 'npm'
68+
cache-dependency-path: chartlets.js/package-lock.json
69+
70+
- run: npm ci
71+
- run: npm run lint
72+
- run: npm run build

.github/workflows/publish-backend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
python-version: ["3.10", "3.11", "3.12"]
14+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1515
defaults:
1616
run:
1717
working-directory: chartlets.py

0 commit comments

Comments
 (0)