ci: add test.yml #1
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: test | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Read and Set Python Version | |
id: set-python-version | |
run: echo "python_version=$(cat .python-version)" >> "$GITHUB_OUTPUT" | |
- name: Install the latest version of rye | |
uses: eifinger/setup-rye@v3 | |
id: setup-rye | |
with: | |
enable-cache: true | |
cache-prefix: ${{ steps.set-python-version.outputs.python_version }} | |
- name: Pin python-version ${{ steps.set-python-version.outputs.python_version }} | |
if: steps.setup-rye.outputs.cache-hit != 'true' | |
run: rye pin ${{ steps.set-python-version.outputs.python_version }} | |
- name: Install dependencies | |
if: steps.setup-rye.outputs.cache-hit != 'true' | |
run: | | |
rye sync --no-lock | |
- name: Run Checks | |
run: | | |
rye lint | |
rye format --check |