Merge pull request #548 from pangeo-forge/combine-fragments-debug-log… #114
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: Integration tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
types: [ opened, reopened, synchronize, labeled ] | |
env: | |
PYTEST_ADDOPTS: "--color=yes" | |
jobs: | |
prepare-env: | |
# run on: | |
# - all pushes to specified branch(es) | |
# - a PR was just labeled 'test-integration' | |
# - a PR with 'test-integration' label was opened, reopened, or synchronized | |
if: | | |
github.event_name == 'push' || | |
github.event.label.name == 'test-integration' || | |
contains( github.event.pull_request.labels.*.name, 'test-integration') | |
uses: ./.github/workflows/prepare-env.yaml | |
integration-tests: | |
needs: prepare-env | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10"] | |
dependencies: ["releases-only", "upstream-dev"] | |
steps: | |
- uses: actions/checkout@v2 | |
# generic steps to load env from cache | |
- name: 🎯 Set cache number | |
id: cache-number | |
# cache will last 3 days by default | |
run: echo CACHE_NUMBER=`expr $(date +'%j') / 3` >> $GITHUB_ENV | |
- name: 🎯 Set environment file | |
id: env-file | |
run: echo "env_file=ci/py${{ matrix.python-version }}.yml" >> $GITHUB_ENV | |
- uses: actions/cache@v2 | |
name: 🗃 Loaded Cached environment | |
with: | |
path: /usr/share/miniconda3/envs/pangeo-forge-recipes | |
key: ${{ runner.os }}-conda-${{ matrix.python-version }}-${{ hashFiles( env.env_file ) }}-${{ matrix.dependencies }}-${{ env.CACHE_NUMBER }} | |
id: conda-cache | |
- name: 🤿 Bail out if no cache hit | |
if: steps.conda-cache.outputs.cache-hit != 'true' | |
run: false | |
- name: 🎯 Set path to include conda python | |
run: echo "/usr/share/miniconda3/envs/pangeo-forge-recipes/bin" >> $GITHUB_PATH | |
# custom testing steps unique to this workflow | |
- name: 🌈 Install pangeo-forge-recipes package | |
shell: bash -l {0} | |
run: | | |
python -m pip install --no-deps -e . | |
- name: 🏄♂️ Run Tests | |
shell: bash -l {0} | |
run: | | |
pytest --timeout=600 tests-integration/ -v |