Merge pull request #2 from climate-resource/integration-test #7
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: | |
pull_request: | |
push: | |
branches: [main] | |
tags: ['v*'] | |
env: | |
BOOKSHELF_DOWNLOAD_CACHE_LOCATION: /tmp/pooch | |
jobs: | |
linting: | |
if: ${{ !github.event.pull_request.draft }} | |
runs-on: ubuntu-latest | |
env: | |
MYPYPATH: stubs | |
PRE_COMMIT_HOME: /tmp/.cache/pre-commit | |
UV_PRERELEASE: allow | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup | |
- name: Cache pre-commit | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/.cache/pre-commit | |
key: ${{ runner.os }}-pre-commit | |
- name: mypy | |
run: | | |
uvx pre-commit run --all-files | |
uv run mypy src | |
tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ "ubuntu-latest" ] | |
python-version: | |
- "3.11" | |
runs-on: "${{ matrix.os }}" | |
defaults: | |
run: | |
shell: bash | |
env: | |
UV_PRERELEASE: allow | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup | |
- name: Set up Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
- name: Cache pooch | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/pooch | |
key: ${{ runner.os }}-${{ matrix.python-version }}-pooch | |
- name: Check build | |
run: | | |
make run | |
- name: Run tests | |
run: | | |
[[ ! -d "tests" ]] && exit 0 | |
uv run pytest tests -r a -v |