ci: 🧼 separate testing and linting into two workflows
This commit is contained in:
parent
7edf5de33c
commit
a648872c0f
2 changed files with 37 additions and 5 deletions
36
.github/workflows/lint.yaml
vendored
Normal file
36
.github/workflows/lint.yaml
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
name: lint
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: install python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: set up poetry
|
||||
uses: abatilo/actions-poetry@v2
|
||||
with:
|
||||
poetry-version: '1.8.2'
|
||||
- name: set up virtual environment
|
||||
run: |
|
||||
poetry config virtualenvs.create true --local
|
||||
poetry config virtualenvs.in-project true --local
|
||||
- name: cache virtual environment
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./.venv
|
||||
key: venv-${{ hashFiles('poetry.lock') }}
|
||||
- name: install dependencies
|
||||
run: poetry install --with dev
|
||||
- name: check linter and formatter
|
||||
run: |
|
||||
poetry run ruff check .
|
||||
poetry run ruff format --check .
|
||||
6
.github/workflows/test.yaml
vendored
6
.github/workflows/test.yaml
vendored
|
|
@ -45,11 +45,7 @@ jobs:
|
|||
path: ./.venv
|
||||
key: venv-${{ hashFiles('poetry.lock') }}
|
||||
- name: install dependencies
|
||||
run: poetry install --with dev,test
|
||||
- name: check linter and formatter
|
||||
run: |
|
||||
poetry run ruff check .
|
||||
poetry run ruff format --check .
|
||||
run: poetry install --with test
|
||||
- name: check migrations
|
||||
run: poetry run python manage.py makemigrations --check
|
||||
- name: run tests
|
||||
|
|
|
|||
Loading…
Reference in a new issue