fixed up comments in warnings. #214
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: NHM-Assist continuous integration | |
on: | |
# run at 6 AM UTC every day | |
# this time is checked below for certain actions: change everywhere if you change | |
schedule: | |
- cron: '0 6 * * *' | |
push: | |
paths-ignore: | |
- '**.md' | |
- '.gitignore' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '.gitignore' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# lint: | |
# name: Lint | |
# runs-on: ubuntu-latest | |
# defaults: | |
# run: | |
# shell: bash | |
# steps: | |
# - name: Checkout repo | |
# uses: actions/checkout@v4 | |
# - name: Setup python | |
# uses: actions/setup-python@v5 | |
# with: | |
# python-version: '3.10' | |
# - name: Install ruff | |
# run: pip install ruff | |
# - name: Lint | |
# run: ruff check . | |
# - name: Check format | |
# run: ruff format . --check | |
test: | |
name: test notebooks | |
# needs: lint | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["macos-latest", "windows-latest", "ubuntu-latest"] | |
python-version: ["3.10",] # "3.11"] | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: environment.yaml | |
cache-environment: true | |
cache-downloads: true | |
- name: Cache Wilamette River domain data | |
id: cache-wilamette | |
uses: actions/cache@v4 | |
with: | |
path: domain_data | |
enableCrossOsArchive: true | |
key: willamette_data | |
- name: Pull Willamette River domain data | |
if: steps.cache-willamette.outputs.cache-hit != 'true' | |
run: | | |
./pull_domain.py --name=willamette_river | |
- name: Scheduled - move cache files to test data retrievals | |
if: github.event.schedule == '0 6 * * *' | |
working-directory: .github/scripts | |
run: | | |
python mv_cache_files_for_scheduled_tests.py | |
# Osx and Linux start with nearly the same speed, Windows is slower. | |
- name: Scheduled - delay Linux to not hit ORDWR servers simultaneously | |
if: ${{ (github.event.schedule == '0 6 * * *') && (runner.os == 'Linux') }} | |
run: | | |
python -c "import time; time.sleep(210)" | |
- name: Test notebooks | |
working-directory: .github/scripts | |
run: | | |
python test_notebooks.py | |
- name: Remove test output files from cache | |
working-directory: .github/scripts | |
run: | | |
python rm_test_output_files_from_cache.py --name=willamette_river | |
- name: Scheduled - restore cache files after scheduled tests | |
if: github.event.schedule == '0 6 * * *' | |
working-directory: .github/scripts | |
run: | | |
python restore_cache_files_after_scheduled_tests.py |