Skip to content

Commit

Permalink
[ci] Run limited checks on PR, full tests on merge
Browse files Browse the repository at this point in the history
  • Loading branch information
aschuh-hf committed Nov 4, 2023
1 parent 12e89c2 commit afedcef
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 3 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: checks

on:
pull_request:
branches:
- main

concurrency:
group: check-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
check:
name: Check with ${{ matrix.py }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
py:
- "3.10"
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
changed:
- 'pyproject.toml'
- 'src/**'
- 'tests/**'
- uses: actions/checkout@v4
if: steps.filter.outputs.changed == 'true'
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.py }}
if: steps.filter.outputs.changed == 'true'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
- name: Install package
if: steps.filter.outputs.changed == 'true'
run: |
pip install --upgrade pip
python -m pip install .[all]
- name: Run test suite
if: steps.filter.outputs.changed == 'true'
run: pytest tests
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 8 * * */2"

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

jobs:
Expand Down Expand Up @@ -40,4 +39,4 @@ jobs:
pip install --upgrade pip
python -m pip install .[all]
- name: Run test suite
run: pytest tests
run: pytest tests

0 comments on commit afedcef

Please sign in to comment.