Switch to rye and ruff #1
Workflow file for this run
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
--- | |
name: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["pypy3.9", "pypy3.10", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
permissions: | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: eifinger/setup-rye@v3 | |
id: setup-rye | |
with: | |
enable-cache: true | |
cache-prefix: ${{ matrix.python-version }} | |
- name: pin python-version ${{ matrix.python-version }} | |
if: steps.setup-rye.outputs.cache-hit != 'true' | |
run: rye pin ${{ matrix.python-version }} | |
- name: install dependencies | |
if: steps.setup-rye.outputs.cache-hit != 'true' | |
run: | | |
rye sync --no-lock | |
- name: run ruff | |
uses: chartboost/ruff-action@v1 | |
- name: run tests | |
run: | | |
echo '```' > pytest.log | |
rye test | tee -a pytest.log | |
echo '```' >> pytest.log | |
- name: PR comment pytest output | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
filePath: pytest.log | |
if: github.event_name == 'pull_request' |