Github unit testing workflow using CTSM container #6
Workflow file for this run
This file contains hidden or 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: Run unit tests with ctsm | |
| on: | |
| pull_request: | |
| jobs: | |
| ctsm-unit-test: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/ngeet/containers/unit-test-ctsm:latest | |
| env: | |
| TESTING_DIR: /CTSM/src/fates/testing/ | |
| BRANCH_NAME: ${{ github.head_ref }} | |
| BRANCH_URL: ${{ github.event.pull_request.head.repo.html_url }} | |
| steps: | |
| - name: Checkout code with git-fleximod | |
| run: | | |
| cd /CTSM | |
| ./bin/git-fleximod update | |
| - name: Echo some output | |
| run: | | |
| echo "HOSTNAME: $HOSTNAME" | |
| echo "HOME: $HOME" | |
| - name: Set up conda environment | |
| uses: conda-incubator/setup-miniconda@v2 | |
| with: | |
| miniconda-version: 'latest' | |
| activate-environment: testing | |
| environment-file: ${{env.TESTING_DIR}}/testing.yml | |
| channels: conda-forge, defaults | |
| - name: Activate spack environment and run tests | |
| run: | | |
| . /opt/spack-environment/activate.sh | |
| echo "NETCDF_FORTRAN_PATH: $NETCDF_FORTRAN_PATH" | |
| echo "NETCDF_C_PATH: $NETCDF_C_PATH" | |
| cd ${{env.TESTING_DIR}} | |
| python run_unit_tests.py --test-list fire_fuel | |