Skip to content

Commit 9dc9795

Browse files
ci: fix artifact upload gating; set PYTHONPATH in CI (#46)
* ci: fix artifact upload gating; add PYTHONPATH in CI and unify matrix * chore(ci): remove stray backup workflow file * ci: install project in CI to satisfy runtime deps before tests
1 parent ba841aa commit 9dc9795

File tree

2 files changed

+41
-16
lines changed

2 files changed

+41
-16
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ on:
44
pull_request:
55
branches: [main]
66
workflow_dispatch:
7+
78
concurrency:
89
group: ${{ github.workflow }}-${{ github.ref }}
910
cancel-in-progress: true
11+
1012
jobs:
1113
build:
1214
name: build (${{ matrix.python-version }})
1315
runs-on: ubuntu-latest
1416
strategy:
1517
fail-fast: false
1618
matrix:
17-
python-version: [ "3.11", "3.12" ]
19+
python-version: ["3.11","3.12"]
1820

1921
steps:
2022
- name: Checkout
@@ -50,18 +52,17 @@ jobs:
5052

5153
- name: Package & smoke-test CLI
5254
run: |
53-
set -euxo pipefail
5455
poetry build
5556
poetry run python -m pip install .
56-
poetry run python -c "import sys, diff_risk_dashboard as m; print(sys.version); print(getattr(m, \"__version__\", \"0.0.0\"))"
57+
poetry run python -c "import sys, diff_risk_dashboard as m; print(sys.version); print(getattr(m, '__version__', '0.0.0'))"
5758
rm -rf _intel && mkdir -p _intel
5859
poetry run python -m diff_risk_dashboard.cli examples/sample_apv.json -f md -o _intel/report.md
5960
ls -l _intel/report.md && head -n 5 _intel/report.md
61+
6062
- name: Upload sample report
61-
if: matrix.python-version == '3.12'
62-
if: matrix.python-version == '3.12'
63-
if: always()
63+
if: ${{ matrix.python-version == '3.12' }}
6464
uses: actions/upload-artifact@v4
6565
with:
6666
name: sample-report
6767
path: _intel/report.md
68+
if-no-files-found: error

.github/workflows/ci.yml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,45 @@ on:
33
pull_request:
44
push:
55
branches: [ main ]
6+
67
jobs:
78
python:
89
name: python (${{ matrix.python-version }})
910
runs-on: ubuntu-latest
1011
strategy:
11-
matrix: { python-version: ["3.11","3.12"] }
12+
fail-fast: false
13+
matrix:
14+
python-version: ["3.11","3.12"]
15+
1216
steps:
13-
- uses: actions/checkout@v5
14-
- uses: actions/setup-python@v5
15-
with: { python-version: ${{ matrix.python-version }} }
16-
- run: python -m pip install -U pip
17-
- run: pip install pytest mypy ruff black
18-
- run: ruff check .
19-
- run: black --check .
20-
- run: pytest -q
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Upgrade pip
26+
run: python -m pip install -U pip
27+
28+
- name: Install tools
29+
30+
- name: Install project
31+
run: pip install -e .
32+
run: pip install pytest mypy ruff black
33+
34+
- name: Ruff
35+
run: ruff check .
36+
37+
- name: Black (check)
38+
run: black --check .
39+
40+
- name: Pytest
41+
env:
42+
PYTHONPATH: src
43+
run: pytest -q
44+
2145
- name: mypy (solo 3.12)
22-
if: matrix.python-version == '3.12'
46+
if: ${{ matrix.python-version == '3.12' }}
2347
run: mypy src

0 commit comments

Comments
 (0)