test #2091
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: test | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - '2.*.x' | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| rose_ref: | |
| description: The Rose branch to test against | |
| required: true | |
| fcm_ref: | |
| description: The FCM branch to test against | |
| required: false | |
| fcm_repo: | |
| description: The FCM repo to test against | |
| required: false | |
| cylc_flow_tag: | |
| description: The cylc-flow branch to test against | |
| required: false | |
| cylc_flow_repo: | |
| description: The cylc-flow repo to test against | |
| required: false | |
| cylc_rose_tag: | |
| description: The cylc-rose branch to test against | |
| required: false | |
| cylc_rose_repo: | |
| description: The cylc-rose repo to test against | |
| required: false | |
| schedule: | |
| - cron: '37 04 * * 1-5' # 04:37, Monday-Friday | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -c "exec $CONDA_PREFIX/bin/bash -elo pipefail {0}" | |
| env: | |
| FORCE_COLOR: 2 | |
| PIP_PROGRESS_BAR: off | |
| jobs: | |
| lint: | |
| strategy: | |
| matrix: | |
| python-version: ['3.12'] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 3 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ inputs.rose_ref || github.sha }} | |
| - name: Configure Python | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| cache-environment: true | |
| post-cleanup: 'all' | |
| environment-name: rose-lint | |
| create-args: >- | |
| python=${{ matrix.python-version }} | |
| bash | |
| shellcheck | |
| - name: Install Rose | |
| run: | | |
| pip install ."[lint]" | |
| yarn install | |
| - name: Flake8 | |
| run: flake8 | |
| - name: Shellchecker | |
| run: etc/bin/shellchecker | |
| - name: ESLint | |
| run: yarn run lint | |
| - name: MyPy | |
| run: | | |
| mypy | |
| - name: Towncrier - draft changelog | |
| uses: cylc/release-actions/towncrier-draft@v1 | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: ${{ contains(matrix.os, 'macos') && 30 || 20 }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ['ubuntu-latest'] | |
| python-version: ['3.12', '3'] | |
| include: | |
| - os: 'macos-latest' | |
| python-version: '3.12' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ inputs.rose_ref || github.sha }} | |
| path: rose | |
| - name: Configure Python | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| cache-environment: true | |
| post-cleanup: 'all' | |
| environment-name: rose-test | |
| create-args: >- | |
| python=${{ matrix.python-version }} | |
| bash | |
| coreutils | |
| sed | |
| sqlite | |
| shellcheck | |
| sqlite | |
| pygraphviz | |
| - name: Patch DNS | |
| uses: cylc/release-actions/patch-dns@v1 | |
| - name: Brew Install | |
| if: startsWith(matrix.os, 'macos') | |
| run: | | |
| brew install subversion | |
| # supress a mac os error | |
| # see NOTE in t/rosie-lookup/00-basic.t | |
| cat >> "$HOME/.bashrc" <<__HERE__ | |
| export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES | |
| __HERE__ | |
| - name: Configure git # Configure Git for Git dependent tests. | |
| uses: cylc/release-actions/configure-git@v1 | |
| - name: Install Rose | |
| working-directory: rose | |
| run: | | |
| pip install ."[tests,docs${{ (startsWith(matrix.os, 'ubuntu') && ',graph,rosa') || '' }}]" | |
| yarn install | |
| - name: Install Cylc | |
| uses: cylc/release-actions/install-cylc-components@v1 | |
| with: | |
| cylc_flow: true | |
| cylc_flow_opts: '' | |
| cylc_flow_repo: ${{ inputs.cylc_flow_repo || 'cylc/cylc-flow' }} | |
| cylc_flow_tag: ${{ inputs.cylc_flow_tag }} | |
| cylc_rose: true | |
| cylc_rose_opts: '' | |
| cylc_rose_repo: ${{ inputs.cylc_rose_repo || 'cylc/cylc-rose' }} | |
| cylc_rose_tag: ${{ inputs.cylc_rose_tag }} | |
| - name: Checkout FCM | |
| if: startsWith(matrix.os, 'ubuntu') | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ inputs.fcm_repo || 'metomi/fcm' }} | |
| ref: ${{ inputs.fcm_ref || 'master' }} | |
| path: 'fcm' | |
| - name: Install FCM | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| # install FCM deps | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| subversion \ | |
| build-essential \ | |
| gfortran \ | |
| libxml-parser-perl \ | |
| libconfig-inifiles-perl \ | |
| libdbi-perl \ | |
| libdbd-sqlite3-perl | |
| # install wandisco | |
| sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu \ | |
| `lsb_release -cs` svn19" \ | |
| >> /etc/apt/sources.list.d/subversion19.list' | |
| sudo wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- \ | |
| | sudo apt-key add - | |
| # prepend FCM bin to $PATH | |
| FCM_PATH="$GITHUB_WORKSPACE/fcm/bin" | |
| # the github actions way (needed for cylc jobs) | |
| echo "$FCM_PATH" >> "${GITHUB_PATH}" | |
| # the bashrc wat (needed for subsequent gh action steps) | |
| echo "export PATH=\"$FCM_PATH:\$PATH\"" >> "$HOME/.bashrc" | |
| - name: Unit Tests | |
| working-directory: rose | |
| run: | | |
| pytest | |
| - name: Functional Tests | |
| timeout-minutes: ${{ contains(matrix.os, 'macos') && 20 || 10 }} | |
| id: functest | |
| working-directory: rose | |
| env: | |
| OBJC_DISABLE_INITIALIZE_FORK_SAFETY: YES | |
| run: | | |
| # rose tests should pass first time around | |
| etc/bin/rose-test-battery -j 4 --state=save | |
| - name: Re-Run Fails | |
| if: failure() && steps.functest.outcome == 'failure' | |
| timeout-minutes: ${{ contains(matrix.os, 'macos') && 10 || 5 }} | |
| working-directory: rose | |
| env: | |
| OBJC_DISABLE_INITIALIZE_FORK_SAFETY: YES | |
| run: | | |
| # so we only re-run for debug purposes | |
| cylc scan --state=all --color=never | |
| etc/bin/rose-test-battery -j 1 -v --state=save,failed | |
| - name: Upload cylc-run artifact | |
| if: failure() && steps.functest.outcome == 'failure' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cylc-run ${{ matrix.os }} py-${{ matrix.python-version }} | |
| path: ~/cylc-run/ | |
| docs: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| strategy: | |
| matrix: | |
| python-version: ['3'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ inputs.rose_ref || github.sha }} | |
| - name: Configure Python | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| cache-environment: true | |
| post-cleanup: 'all' | |
| environment-name: rose-docs | |
| create-args: >- | |
| python=${{ matrix.python-version }} | |
| bash | |
| pygraphviz | |
| - name: Install Rose | |
| run: | | |
| pip install -e .[docs,graph] --upgrade-strategy='only-if-needed' | |
| - name: Install Cylc | |
| uses: cylc/release-actions/install-cylc-components@v1 | |
| with: | |
| cylc_flow: true | |
| cylc_flow_opts: '' | |
| cylc_flow_repo: ${{ inputs.cylc_flow_repo || 'cylc/cylc-flow' }} | |
| cylc_flow_tag: ${{ inputs.cylc_flow_tag }} | |
| cylc_rose: true | |
| cylc_rose_opts: '' | |
| cylc_rose_repo: ${{ inputs.cylc_rose_repo || 'cylc/cylc-rose' }} | |
| cylc_rose_tag: ${{ inputs.cylc_rose_tag }} | |
| - name: build (html) | |
| run: | | |
| make -C sphinx/ html SPHINXOPTS='-Wn' | |
| # - name: build (slides) | |
| # run: | | |
| # make -C sphinx/ slides SPHINXOPTS='-Wn' | |
| - name: build (linkcheck) | |
| run: | | |
| make -C sphinx/ linkcheck SPHINXOPTS='-Wn' | |
| - name: debug | |
| if: failure() | |
| run: | | |
| cat /tmp/sphinx-err* >&2 || true |