Skip to content

Commit

Permalink
ci: use uv and matrix testing
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinatian committed Jan 28, 2025
1 parent 5d74f54 commit 44bebaa
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,45 @@ on:
- main

jobs:
deploy-and-test:
test:
name: continuous-integration
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.10.16
uses: actions/setup-python@v5
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: 3.10.16

- name: Setup PDM
uses: pdm-project/setup-pdm@v4

- name: Install PDM dependencies and initialize project repository
run: pdm install
# Install a specific version of uv.
version: "0.5.24"
enable-cache: true
cache-dependency-glob: "uv.lock"
python-version: ${{ matrix.python-version }}

- name: Activate Virtual Environment
run: pdm venv activate
- name: Install the project
run: uv sync --all-extras --dev

- name: Install pip and other dependencies
run: |
python -m pip install --upgrade pip
python -m pip install types-beautifulsoup4 types-requests
pip install -r requirements.txt
- name: Lint code check
run: uv run -- ruff check src tests

- name: Format code
run: pdm format
- name: Format code check
run: uv run -- ruff format --check src tests

# - name: Lint code
# run: pdm lint
- name: Format docs check
run: uv run -- mdformat --check docs README.md

- name: Run Tests
run: pdm test
- name: Run tests
# For example, using `pytest`
run: uv run pytest tests
env:
GRADESCOPE_CI_STUDENT_EMAIL: ${{ secrets.GRADESCOPE_CI_STUDENT_EMAIL }}
GRADESCOPE_CI_STUDENT_PASSWORD: ${{ secrets.GRADESCOPE_CI_STUDENT_PASSWORD }}
Expand Down

0 comments on commit 44bebaa

Please sign in to comment.