Skip to content

Commit ee2eb34

Browse files
committed
ci: fix artifact upload gating; add PYTHONPATH in CI and unify matrix
1 parent ba841aa commit ee2eb34

File tree

3 files changed

+104
-16
lines changed

3 files changed

+104
-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/build.yml.bak

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
on:
2+
push:
3+
branches: [main]
4+
pull_request:
5+
branches: [main]
6+
workflow_dispatch:
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
jobs:
11+
build:
12+
name: build (${{ matrix.python-version }})
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: [ "3.11", "3.12" ]
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Upgrade pip
29+
run: python -m pip install --upgrade pip
30+
31+
- name: Install Poetry
32+
run: pip install poetry
33+
34+
- name: Install dependencies
35+
run: poetry install --no-interaction
36+
37+
- name: Ruff
38+
run: poetry run ruff check .
39+
40+
- name: Black (check)
41+
run: poetry run black --check .
42+
43+
- name: Pytest
44+
env:
45+
PYTHONPATH: src
46+
run: poetry run pytest -q
47+
48+
- name: Mypy
49+
run: poetry run mypy src
50+
51+
- name: Package & smoke-test CLI
52+
run: |
53+
set -euxo pipefail
54+
poetry build
55+
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+
rm -rf _intel && mkdir -p _intel
58+
poetry run python -m diff_risk_dashboard.cli examples/sample_apv.json -f md -o _intel/report.md
59+
ls -l _intel/report.md && head -n 5 _intel/report.md
60+
- name: Upload sample report
61+
if: matrix.python-version == '3.12'
62+
if: always()
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: sample-report
66+
path: _intel/report.md

.github/workflows/ci.yml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,42 @@ 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+
run: pip install pytest mypy ruff black
30+
31+
- name: Ruff
32+
run: ruff check .
33+
34+
- name: Black (check)
35+
run: black --check .
36+
37+
- name: Pytest
38+
env:
39+
PYTHONPATH: src
40+
run: pytest -q
41+
2142
- name: mypy (solo 3.12)
22-
if: matrix.python-version == '3.12'
43+
if: ${{ matrix.python-version == '3.12' }}
2344
run: mypy src

0 commit comments

Comments
 (0)