-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github actions cache, and create dep groups in pyproject for CI
- Loading branch information
Showing
12 changed files
with
161 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Code Quality | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
id: cql | ||
with: | ||
python-version: '3.11' | ||
cache: 'poetry' | ||
|
||
# Install lint deps only | ||
- name: Install dependencies | ||
if: steps.cql.outputs.cache-hit != 'true' | ||
run: poetry install --only=lint --no-interaction --no-root | ||
|
||
- name: Check code quality | ||
run: poetry run ruff check . | ||
|
||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
id: cqf | ||
with: | ||
python-version: '3.11' | ||
cache: 'poetry' | ||
|
||
# Install lint deps only | ||
- name: Install dependencies | ||
if: steps.cqf.outputs.cache-hit != 'true' | ||
run: poetry install --only=lint --no-interaction --no-root | ||
|
||
- name: Check code style | ||
run: poetry run ruff format --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Code Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.11', '3.12', '3.13'] | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
# Set up python versions with matrix to test on multiple versions | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
id: ctut-${{ matrix.python-version}} | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'poetry' | ||
|
||
# Install all test dependencies | ||
- name: Install dependencies | ||
if: steps.ctut-${{ matrix.python-version }}.outputs.cache-hit != 'true' | ||
run: poetry install --only=test --no-interaction --no-root | ||
|
||
- name: Run tests | ||
run: poetry run pytest tests/test_unit | ||
|
||
# # Upload coverage reports to Codecov once the tests start running 😭 | ||
# - name: Upload coverage reports to Codecov | ||
# uses: codecov/codecov-action@v3 | ||
# env: | ||
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This workflow should work but will fail | ||
# as the code has no types, will add types to the | ||
# code and then uncomment it 👍 | ||
name: Type Check | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check-type: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up python | ||
id: tcct | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
cache: 'poetry' | ||
|
||
# Install only type check dependency | ||
- name: Install dependencies | ||
if: steps.tcct.outputs.cache-hit != 'true' | ||
run: poetry install --only=type --no-root | ||
|
||
- name: Check types | ||
run: poetry run mypy tesk/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters