Skip to content

fix: rye install

fix: rye install #97

Workflow file for this run

name: lint & test
on:
push:
branches: [dev]
pull_request:
branches: [dev, main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install rye
env:
RYE_INSTALL_OPTION: '--yes'
run: |
curl -sSf https://rye-up.com/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
- name: set python version
id: set-python
run: |
rye config --set-bool behavior.use-uv=true
rye pin cpython@${{ matrix.python-version }}
cat .python-version
VERSION=$(cat .python-version)
echo "python_version=${VERSION}" >> $GITHUB_OUTPUT
- name: Load cached venv
id: cached-venv-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.set-python.outputs.python_version }}-${{ hashFiles('**/pyproject.toml') }}
- name: Install dependencies
if: steps.cached-venv-dependencies.outputs.cache-hit != 'true'
run: |
rye pin cpython@${{ steps.set-python.outputs.python_version }}
rye sync --features uvloop
- name: Load cached pre-commit
id: cached-pre-commit-dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: precommit-${{ runner.os }}-${{ steps.set-python.outputs.python_version }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Code checks
run: |
rye run pre-commit run --all-files --show-diff-on-failure
- name: Test with pytest
run: |
rye run pytest
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
if: matrix.python-version == '3.12'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}