diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a31757e --- /dev/null +++ b/.github/workflows/ci.yml @@ -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