Hotfix: Updating ref value in GitHub dispatch action for triggering C… #159
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: CI Unit Tests | |
| on: [pull_request, push, workflow_dispatch] | |
| env: | |
| ROCOTO_VERSION: "1.3.7" | |
| jobs: | |
| ci_pytest: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout global-workflow | |
| uses: actions/checkout@v4 | |
| with: | |
| path: global-workflow | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11.8 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y perl libxml-libxml-perl libxml-libxslt-perl libdatetime-perl | |
| python -m pip install --upgrade pip | |
| python -m pip install -r global-workflow/dev/workflow/requirements.txt | |
| pip install pytest pytest-cov pyyaml jinja2 wget | |
| - name: Cache Rocoto | |
| id: cache-rocoto | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| rocoto-${{ env.ROCOTO_VERSION }} | |
| key: ${{ runner.os }}-rocoto-${{ env.ROCOTO_VERSION }} | |
| - name: Install Rocoto | |
| id: install-rocoto | |
| if: steps.cache-rocoto.outputs.cache-hit != 'true' | |
| run: | | |
| git clone https://github.com/christopherwharrop/rocoto.git rocoto-${{ env.ROCOTO_VERSION }} | |
| cd rocoto-${{ env.ROCOTO_VERSION }} | |
| git checkout ${{ env.ROCOTO_VERSION }} | |
| ./INSTALL | |
| echo "export PATH=${PWD}/bin:\$PATH" >> rocoto_path.sh | |
| chmod +x rocoto_path.sh | |
| - name: Run tests | |
| shell: bash | |
| run: | | |
| sudo mkdir -p /scratch1/NCEPDEV | |
| sudo mkdir -p /scratch1/NCEPDEV/stmp2 | |
| sudo mkdir -p /scratch1/NCEPDEV/stmp4 | |
| sudo mkdir -p /scratch1/NCEPDEV/global | |
| sudo chmod -R a+w /scratch1/NCEPDEV | |
| source rocoto-${{ env.ROCOTO_VERSION }}/rocoto_path.sh | |
| cd global-workflow/sorc | |
| git submodule update --init -j 2 wxflow ufs_model.fd | |
| ./link_workflow.sh | |
| # Create test data directory for unit tests | |
| mkdir -p ../dev/ci/scripts/unittests/test_data | |
| echo "Creating test directories and files for CI tests" | |
| cd ../dev/ci/scripts/unittests | |
| pytest -v --junitxml test-results.xml | |
| - name: Publish Test Results | |
| if: always() | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| with: | |
| files: global-workflow/dev/ci/scripts/unittests/test-results.xml | |
| job_summary: true | |
| comment_mode: off |