Skip to content

Commit f3d5309

Browse files
committed
CI workflow improvements
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
1 parent 58405c8 commit f3d5309

5 files changed

Lines changed: 76 additions & 14 deletions

File tree

.github/codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
codecov:
2+
notify:
3+
after_n_builds: 4

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [ main ]
7+
push:
8+
branches: [ main ]
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
pre-commit:
19+
uses: ./.github/workflows/step_pre-commit.yml
20+
tests:
21+
needs: [ pre-commit ]
22+
uses: ./.github/workflows/step_test.yml
23+
pass:
24+
if: always()
25+
needs: [ pre-commit, tests ]
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: re-actors/alls-green@release/v1
29+
with:
30+
jobs: ${{ toJSON(needs) }}

.github/workflows/pre-commit.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
on:
2+
workflow_call:
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
pre-commit:
9+
name: Run pre-commit
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v4
14+
with:
15+
python-version: 3.x
16+
- uses: pre-commit/action@v3.0.0

.github/workflows/step_test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on:
2+
workflow_call:
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
checks:
9+
name: Check 🐍 ${{ matrix.python-version }}
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: ["3.9", "3.10", "3.11", "3.12"]
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install hatch
21+
run: pip install hatch
22+
- name: Test package
23+
run: hatch run cov:xml
24+
- name: Upload coverage report
25+
uses: codecov/codecov-action@v3
26+
with:
27+
name: python-${{ matrix.python-version }}

0 commit comments

Comments
 (0)