diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 2da52d4..46c608f 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -1,4 +1,4 @@ -name: lint & test +name: test on: push: @@ -6,11 +6,13 @@ on: paths: - "**.py" - ".github/workflows/check.yaml" + - "pyproject.toml" pull_request: branches: [dev, main] paths: - "**.py" - ".github/workflows/check.yaml" + - "pyproject.toml" jobs: build: @@ -41,17 +43,6 @@ jobs: run: | rye sync - - name: Load cached pre-commit - id: cached-pre-commit-dependencies - uses: actions/cache@v4 - with: - path: ~/.cache/pre-commit - key: precommit-${{ runner.os }}-${{ steps.install-rye.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }} - - - name: Code checks - run: | - rye run pre-commit run --all-files --show-diff-on-failure - - name: Test with pytest run: | rye run pytest diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..54d791a --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,34 @@ +name: lint + +on: + push: + branches: [dev] + paths: + - "**.py" + - ".github/workflows/check.yaml" + - "pyproject.toml" + pull_request: + branches: [dev, main] + paths: + - "**.py" + - ".github/workflows/check.yaml" + - "pyproject.toml" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install rye + uses: phi-friday/install-rye@v1.5 + id: install-rye + with: + python_version: "3.8" + use_uv: true + + - name: Code checks + run: | + rye install pre-commit + pre-commit run --all-files --show-diff-on-failure \ No newline at end of file