fix ci #5
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: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# 1. Checkout the repository | |
- uses: actions/checkout@v3 | |
# 2. Set up Python 3.12 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
# 3. Install Rye | |
- name: Install Rye | |
run: | | |
curl -sSf https://rye.astral.sh/get | bash -s -- --yes </dev/null | |
# 4. Configure Rye for global shims | |
- name: Configure Rye | |
run: | | |
rye config --set-bool behavior.global-python=true | |
echo 'source "$HOME/.rye/env"' >> $HOME/.profile | |
shell: bash | |
# 5. Add Rye shims and bin to PATH | |
- name: Add Rye to PATH | |
run: | | |
echo "$HOME/.rye/shims" >> $GITHUB_PATH | |
echo "$HOME/.rye/bin" >> $GITHUB_PATH | |
# 6. Build the virtual environment using Rye | |
- name: Build virtual environment | |
run: | | |
rye sync | |
# 7. Run tests using Rye-managed pytest | |
- name: Run tests | |
run: | | |
rye run pytest |