diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adca99d..396fe8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,21 +1,32 @@ name: Test on: pull_request: - paths-ignore: "*.rst" push: - # paths-ignore: "*.rst" branches: [master, develop] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - pre-commit: + check-paths: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - run: pipx run pre-commit run --all-files + with: + fetch-depth: 0 + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 + id: changes + with: + filters: | + nondoc: + - '!**/*.rst' + - run: echo 'changed=${{ steps.changes.outputs.nondoc }}' >> "$GITHUB_OUTPUT" + id: changed + outputs: + changed: ${{ steps.changed.outputs.changed }} build-test: + needs: check-paths + if: needs.check-paths.outputs.changed == 'true' runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -41,3 +52,16 @@ jobs: python -m pip install --editable .[dev] - name: Test with tox run: tox -e py + + pass: + needs: build-test + if: always() + runs-on: ubuntu-latest + steps: + - name: fail if build-test ran and failed + if: ${{ needs.build-test.result == 'failure' }} + run: exit 1 + - name: Curiosity + run: | + echo "$GITHUB_OUTPUT" + cat "$GITHUB_OUTPUT"