Merge pull request #174 from nsidc/remove_reference_ncattr #653
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 | |
# Default to bash in login mode; key to activating conda environment | |
# https://github.com/mamba-org/provision-with-micromamba#IMPORTANT | |
defaults: | |
run: | |
shell: "bash -l {0}" | |
jobs: | |
test: | |
name: "Run tests" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Check out repository" | |
uses: "actions/checkout@v4" | |
- name: "Install Conda environment" | |
uses: "mamba-org/setup-micromamba@v1" | |
with: | |
micromamba-version: '1.5.10-0' # any version from https://github.com/mamba-org/micromamba-releases | |
environment-file: "conda-lock.yml" | |
# When using a lock-file, we have to set an environment name. | |
environment-name: "seaice_ecdr-ci" | |
cache-environment: true | |
# Increase this key to trigger cache invalidation | |
cache-environment-key: 2 | |
# Linter | |
- name: "Run pre-commit tests" | |
run: "pre-commit run --all-files" | |
# Check out repos resquired for unit tests. | |
- name: "Check out pm_icecon repository" | |
uses: "actions/checkout@v4" | |
with: | |
repository: "nsidc/pm_icecon" | |
ref: "main" | |
path: "pm_icecon" | |
- name: "Check out pm_tb_data repository" | |
uses: "actions/checkout@v4" | |
with: | |
repository: "nsidc/pm_tb_data" | |
ref: "main" | |
path: "pm_tb_data" | |
# Our code expects `/share/apps/G02202_V5` to exist already, and raises an | |
# error if it does not. This would be a sign, on NSIDC infrastructure, | |
# that NFS mounts are not setup correctly. For CI, we can just create | |
# those dirs: | |
- name: "Make share dir" | |
run: "sudo mkdir -p /share/apps/G02202_V5 && sudo chown -R runner:runner /share/" | |
# Unit tests | |
- name: "Run typecheck and tests" | |
run: "PYTHONPATH=/home/runner/work/seaice_ecdr/seaice_ecdr/:/home/runner/work/seaice_ecdr/seaice_ecdr/pm_icecon/:/home/runner/work/seaice_ecdr/seaice_ecdr/pm_tb_data/ DISABLE_FILE_LOGGING=TRUE invoke test.ci" |