Skip to content

Commit

Permalink
Add CI workflow for linting and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mnixry committed Mar 18, 2024
1 parent 8a45dc5 commit 0575ec6
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Test & Lint

on:
push:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@v4
with:
python-version: "3.10"
cache: true

- name: Install dependencies
run: |
pdm install -G :all
echo `dirname $(pdm info --python)` >> $GITHUB_PATH
- name: Lint with Ruff
continue-on-error: true
run: pdm lint --output-format github

- name: Lint with Pyright
uses: jakebailey/pyright-action@v2
continue-on-error: true
with:
pylance-version: latest-release

test:
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

runs-on: ${{ matrix.os }}

env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
cache: true

- name: Install dependencies
shell: bash
run: |
pdm install -G :all
echo `dirname $(pdm info --python)` >> $GITHUB_PATH
- name: Run tests
run: pdm test

- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTHON_VERSION,OS
fail_ci_if_error: true

0 comments on commit 0575ec6

Please sign in to comment.