Skip to content

Commit

Permalink
CI workflow improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <[email protected]>
  • Loading branch information
LecrisUT committed Jun 17, 2024
1 parent c8cdf1a commit a39e383
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
codecov:
notify:
after_n_builds: 4
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
workflow_dispatch:
pull_request:
branches: [ main ]
push:
branches: [ main ]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pre-commit:
uses: ./.github/workflows/step_pre-commit.yml
tests:
needs: [ pre-commit ]
uses: ./.github/workflows/step_test.yml
pass:
if: always()
needs: [ pre-commit, tests ]
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
14 changes: 0 additions & 14 deletions .github/workflows/pre-commit.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/step_pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
on:
workflow_call:

permissions:
contents: read

jobs:
pre-commit:
name: Run pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: pre-commit/[email protected]
27 changes: 27 additions & 0 deletions .github/workflows/step_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
workflow_call:

permissions:
contents: read

jobs:
checks:
name: Check 🐍 ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install hatch
run: pip install hatch
- name: Test package
run: hatch run cov:xml
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
name: python-${{ matrix.python-version }}

0 comments on commit a39e383

Please sign in to comment.