Skip to content

Commit

Permalink
action
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-friday committed Jul 27, 2024
1 parent a3468ed commit f9db40c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: lint & test
name: test

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:
Expand Down Expand Up @@ -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
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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

0 comments on commit f9db40c

Please sign in to comment.