diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 858e490..1a05264 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,11 +2,7 @@ name: CI on: push: - paths: - - src/** - - tests/** - - scripts/** - - .github/workflows/ci.yml + branches: ["**"] pull_request_target: types: [labeled] @@ -19,26 +15,43 @@ jobs: - name: checkout uses: actions/checkout@v4 + - name: check changes + uses: dorny/paths-filter@v3 + id: changes + with: + filters: | + sources: + - src/** + - tests/** + - scripts/** + - name: Install Rye + if: steps.changes.outputs.sources == 'true' uses: eifinger/setup-rye@v1 with: enable-cache: true - cache-prefix: 'refiners-rye-cache' + cache-prefix: "refiners-rye-cache" - name: add home shims dir to PATH + if: steps.changes.outputs.sources == 'true' run: echo "$HOME/.rye/shims" >> $GITHUB_PATH - name: pin python + if: steps.changes.outputs.sources == 'true' run: rye pin 3.10 - name: rye sync + if: steps.changes.outputs.sources == 'true' run: rye sync --all-features - name: ruff format + if: steps.changes.outputs.sources == 'true' run: rye run ruff format --check . - name: ruff check + if: steps.changes.outputs.sources == 'true' run: rye run ruff check . - name: typecheck + if: steps.changes.outputs.sources == 'true' run: rye run pyright