diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..c5022a1 --- /dev/null +++ b/.github/workflows/checks.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e809ade..e3890db 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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: @@ -40,4 +39,4 @@ jobs: pip install --upgrade pip python -m pip install .[all] - name: Run test suite - run: pytest tests + run: pytest tests \ No newline at end of file