Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add lint workflow and ci workflow #4

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:

runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install uv
python -m uv pip install --system --upgrade pip wheel
uv pip install --system pytest coverage
uv pip install --system --strict --requirement requirements.lock

- name: List installed Python packages
run: python -m pip list

- name: Test with pytest and coverage
run: |
coverage run --module pytest tests/
22 changes: 13 additions & 9 deletions .github/workflows/python.yaml → .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python checks
name: Lint

on:
push:
Expand All @@ -7,28 +7,32 @@ on:
branches: [ main ]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
python -m pip install uv
python -m uv pip install --system --upgrade pip wheel
python -m uv pip install --system ruff black

- name: List installed Python packages
run: python -m pip list

- name: Lint with ruff
run: ruff check .

- name: Check formatting with black
run: black . --check --verbose

- name: Run unit tests
run: |
pytest
Loading