Skip to content

Commit

Permalink
Move CI lint to separate state
Browse files Browse the repository at this point in the history
  • Loading branch information
dvolodin7 committed Mar 2, 2025
1 parent 9b3cf81 commit 8130017
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 11 deletions.
52 changes: 41 additions & 11 deletions .github/workflows/py-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,47 @@ on:
release:
types: ["published"]
jobs:
lint:
runs-on: ubuntu-24.04
strategy:
fail-fast: true
matrix:
# Use only one version
python-version: ["3.9"]
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Set Up Python {{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# Cache dependencies
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: ./.pip
key: ${{ runner.os }}-lint-{{ matrix.python-version }}-${{ hashFiles('./.requirements/lint.txt') }}

- name: Upgrade Pip
run: python -m pip install --upgrade pip

- name: Install Dependencies
run: pip install -IU ./.requirements/lint.txt

- name: Check Formatting
run: ruff format --check src/ tests/

- name: Check Ruff
run: ruff check -q src/ tests/

- name: Check Mypy
run: mypy src/

test:
runs-on: ubuntu-24.04
needs: lint
strategy:
fail-fast: true
matrix:
Expand All @@ -40,7 +79,7 @@ jobs:
uses: actions/cache@v4
with:
path: ./.pip
key: ${{ runner.os }}-tests-{{ matrix.python-version }}-${{ hashFiles('./.requirements/lint.txt') }}-${{ hashFiles('./.requirements/test.txt') }}
key: ${{ runner.os }}-tests-{{ matrix.python-version }}-${{ hashFiles('./.requirements/test.txt') }}

- name: Upgrade Pip
run: python -m pip install --upgrade pip
Expand All @@ -49,16 +88,7 @@ jobs:
run: pip install --upgrade build

- name: Install Dependencies
run: pip install -IU -r ./.requirements/deps.txt -r ./.requirements/lint.txt -r ./.requirements/test.txt

- name: Check Formatting
run: ruff format --check src/ tests/

- name: Check Ruff
run: ruff -q src/ tests/

- name: Check Mypy
run: mypy src/
run: pip install -IU -r ./.requirements/deps.txt -r ./.requirements/test.txt

- name: Run Tests
run: coverage run -m pytest -v
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ To see unreleased changes, please see the [CHANGELOG on the master branch](https
### Infrastructure

* Use `ruff` for formatting
* Move CI lint to separate step

## 0.7.0 - 2025-01-23

Expand Down

0 comments on commit 8130017

Please sign in to comment.