Skip to content

[IGNORE] Add cirrus-testing workflow #15

[IGNORE] Add cirrus-testing workflow

[IGNORE] Add cirrus-testing workflow #15

name: Check ctsm-ci-derecho-gnu Dockerfile matches derecho's gnu stack
on:
push:
# The "branches" line is required, or this also runs on tag pushes even when
# none of the watched files changed (same as check-clm6-aliases.yml).
# '**' rather than '*': the single star does not match a '/', so branch
# names like feature/x would silently never trigger this check.
branches: ['**']
paths:
- 'docker/ctsm-ci-derecho-gnu/Dockerfile'
- 'docker/ctsm-ci-derecho-gnu/derecho-versions.ini'
- 'docker/ctsm-ci-derecho-gnu/check-derecho-versions.py'
- 'docker/ctsm-ci-derecho-gnu/test_check_derecho_versions.py'
- '.github/workflows/derecho-version-check.yml'
# ccs_config is a submodule; a config_machines.xml change arrives as a
# bump of the ccs_config gitlink. Its gitlink and the .gitmodules fxtag
# are kept consistent by a separate check, so watching the gitlink path
# is enough -- also watching .gitmodules would over-trigger on unrelated
# submodule bumps.
- 'ccs_config'
pull_request:
paths:
- 'docker/ctsm-ci-derecho-gnu/Dockerfile'
- 'docker/ctsm-ci-derecho-gnu/derecho-versions.ini'
- 'docker/ctsm-ci-derecho-gnu/check-derecho-versions.py'
- 'docker/ctsm-ci-derecho-gnu/test_check_derecho_versions.py'
- '.github/workflows/derecho-version-check.yml'
- 'ccs_config'
# The scheduled run is the one that reads derecho's module tree live, so it
# catches drift that no PR touched. GitHub only fires schedules from the
# default branch, so this does nothing until the workflow is merged to master;
# until then, exercise the same path with workflow_dispatch.
schedule:
- cron: '23 13 * * 1'
workflow_dispatch:
jobs:
check-derecho-versions:
# The live module-tree read needs /glade, which only the self-hosted Cirrus
# runner has. The PR/push gate reads in-repo files only, so it stays on a
# hosted runner and does not consume Cirrus capacity.
runs-on: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 'gha-runner-ctsm' || 'ubuntu-latest' }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.x'
# ccs_config (which holds machines/derecho/config_machines.xml) is a
# fleximod external; pull just that one component.
- name: Check out ccs_config
run: bin/git-fleximod update ccs_config
# Runs first: if the checker's own logic is broken, the result of the
# check below means nothing. Needs no ccs_config and no /glade -- it
# builds its own fixtures.
- name: Test check-derecho-versions.py
run: python docker/ctsm-ci-derecho-gnu/test_check_derecho_versions.py
# --skip-module-tree on pull_request and push only. Those run on a hosted
# runner with no /glade, so they can compare only in-repo files; the
# module-existence check would fail there for the wrong reason. The
# scheduled (and workflow_dispatch) run is on the Cirrus runner, does the
# live read, and must fail loudly if /glade cannot be reached -- so it
# must NOT carry the flag.
- name: Check Dockerfile versions against derecho's gnu stack
run: >-
python docker/ctsm-ci-derecho-gnu/check-derecho-versions.py
${{ (github.event_name == 'pull_request' || github.event_name == 'push') && '--skip-module-tree' || '' }}