. #18
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: Tests | |
on: | |
push: | |
branches: | |
- main | |
- master | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
pytest: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -el {0} # setup-miniconda requires bash | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup conda | |
uses: deargen/workflows/actions/setup-conda-and-uv@master | |
- name: Cache Conda environment | |
id: cache-conda | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-conda | |
with: | |
path: ~/miniconda3/envs/test | |
key: ${{ runner.os }}-conda-${{ env.cache-name }}-${{ hashFiles('deps/lock/x86_64-manylinux_2_28/requirements_dev.txt') }} | |
# restore-keys: | | |
# ${{ runner.os }}-conda-${{ env.cache-name }}- | |
# ${{ runner.os }}-conda- | |
# ${{ runner.os }}- | |
- if: steps.cache-conda.outputs.cache-hit == 'true' | |
run: echo 'conda cache hit!' | |
- name: Install dependencies | |
if: steps.cache-conda.outputs.cache-hit != 'true' | |
run: | | |
# python -m pip install --upgrade pip | |
uv pip install -r deps/lock/x86_64-manylinux_2_28/requirements_dev.txt | |
uv pip install -e . | |
bash scripts/install_binaries.sh | |
- name: Run pytest | |
uses: deargen/workflows/actions/run-pytest@master | |
doctest: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -el {0} # setup-miniconda requires bash | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup conda | |
uses: deargen/workflows/actions/setup-conda-and-uv@master | |
- name: Cache Conda environment | |
id: cache-conda | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-conda | |
with: | |
path: ~/miniconda3/envs/test | |
key: ${{ runner.os }}-conda-${{ env.cache-name }}-${{ hashFiles('deps/lock/x86_64-manylinux_2_28/requirements_dev.txt') }} | |
# restore-keys: | | |
# ${{ runner.os }}-conda-${{ env.cache-name }}- | |
# ${{ runner.os }}-conda- | |
# ${{ runner.os }}- | |
- if: steps.cache-conda.outputs.cache-hit == 'true' | |
run: echo 'conda cache hit!' | |
- name: Install dependencies | |
if: steps.cache-conda.outputs.cache-hit != 'true' | |
run: | | |
# python -m pip install --upgrade pip | |
uv pip install -r deps/lock/x86_64-manylinux_2_28/requirements_dev.txt | |
uv pip install -e . | |
bash scripts/install_binaries.sh | |
- name: Run doctest | |
uses: deargen/workflows/actions/run-doctest@master |