Tests #2531
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" ] | |
paths-ignore: | |
- 'docs/**' | |
pull_request: | |
branches: [ "main" ] | |
paths-ignore: | |
- 'docs/**' | |
schedule: | |
- cron: '0 4 * * *' # run once a day at 4 AM | |
env: | |
PYTEST_ADDOPTS: "--color=yes" | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10", "3.11","3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # checkout tags (which is not done by default) | |
- name: π Setup Python | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: pyproject.toml | |
- name: π― Check cache hit | |
run: echo '${{ steps.setup-python.outputs.cache-hit }}' | |
- name: π Install pangeo-forge-recipes package | |
shell: bash -l {0} | |
run: | | |
python -m pip install -e ".[test]" | |
- name: π§βπ» On the nightly run, test upstream dev versions | |
if: | | |
github.event_name == 'schedule' | |
shell: bash -l {0} | |
run: | | |
python -m pip install -Ur ci/requirements-upstream-dev.txt | |
python -m pip install -U --pre apache-beam | |
- name: πββοΈ Run Tests | |
shell: bash -l {0} | |
run: | | |
py.test tests -v -n auto \ | |
--cov=pangeo_forge_recipes --cov-config .coveragerc \ | |
--cov-report term-missing \ | |
--cov-report xml \ | |
--durations=10 --durations-min=1.0 | |
- name: π¦ Run Codecov | |
if: | | |
github.event_name == 'push' || | |
github.event_name == 'pull_request' | |
uses: codecov/codecov-action@v4.5.0 | |
with: | |
file: ./coverage.xml | |
env_vars: OS,PYTHON | |
name: codecov-umbrella | |
fail_ci_if_error: false |