|
| 1 | +name: EAMxx standalone testing |
| 2 | + |
| 3 | +on: |
| 4 | + # Runs on PRs against master |
| 5 | + pull_request: |
| 6 | + branches: [ master ] |
| 7 | + types: [opened, synchronize, ready_for_review, reopened] |
| 8 | + paths: |
| 9 | + - components/eamxx |
| 10 | + - components/eam/src/physics/rrtmgp |
| 11 | + - components/eam/src/physics/p3/scream |
| 12 | + - components/eam/src/physics/cam |
| 13 | + |
| 14 | + # Manual run is used to bless |
| 15 | + workflow_dispatch: |
| 16 | + inputs: |
| 17 | + jobs_list: |
| 18 | + description: 'Job to run' |
| 19 | + required: true |
| 20 | + type: choice |
| 21 | + options: |
| 22 | + - gcc-openmp |
| 23 | + bless: |
| 24 | + description: 'Generate baselines' |
| 25 | + required: true |
| 26 | + type: boolean |
| 27 | + |
| 28 | + # Add schedule trigger for nightly runs at midnight MT (Standard Time) |
| 29 | + # schedule: |
| 30 | + # - cron: '0 7 * * *' # Runs at 7 AM UTC, which is midnight MT during Standard Time |
| 31 | + |
| 32 | +concurrency: |
| 33 | + # Two runs are in the same group if: |
| 34 | + # - they have the same trigger |
| 35 | + # - if trigger=pull_request, the PR number must match |
| 36 | + # - if trigger=workflow_dispatch, the inputs are the same |
| 37 | + group: ${{ github.workflow }}-${{ github.event_name }}-${{ |
| 38 | + github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id |
| 39 | + }} |
| 40 | + cancel-in-progress: true |
| 41 | + |
| 42 | +jobs: |
| 43 | + gcc-openmp: |
| 44 | + runs-on: [self-hosted, ghci-snl-cpu, gcc] |
| 45 | + strategy: |
| 46 | + fail-fast: true |
| 47 | + matrix: |
| 48 | + build_type: [sp, dbg, fpe, opt] |
| 49 | + # Run this workflow if: |
| 50 | + # - workflow_dispatch: user requested this job. |
| 51 | + # - schedule: always: |
| 52 | + # - pull_request: matching skip label is NOT found |
| 53 | + if: | |
| 54 | + ${{ |
| 55 | + github.event_name == 'schedule' || |
| 56 | + ( github.event_name == 'workflow_dispatch' && github.event.inputs.jobs_list == 'gcc-openmp' ) || |
| 57 | + ( |
| 58 | + github.event_name == 'pull_request' && |
| 59 | + !( |
| 60 | + contains(github.event.pull_request.labels.*.name, 'AT: skip gcc') || |
| 61 | + contains(github.event.pull_request.labels.*.name, 'AT: skip openmp') || |
| 62 | + contains(github.event.pull_request.labels.*.name, 'AT: skip eamxx-standalone') || |
| 63 | + contains(github.event.pull_request.labels.*.name, 'AT: skip all') |
| 64 | + ) |
| 65 | + ) |
| 66 | + }} |
| 67 | + name: gcc-openmp-${{ matrix.build_type }} |
| 68 | + steps: |
| 69 | + - name: Show action trigger |
| 70 | + uses: actions/github-script@v7 |
| 71 | + with: |
| 72 | + script: | |
| 73 | + const eventName = context.eventName; |
| 74 | + const eventAction = context.payload.action || 'N/A'; |
| 75 | + const actor = context.actor; |
| 76 | + console.log(`The job was triggered by a ${eventName} event.`); |
| 77 | + console.log(` - Event action: ${eventAction}`); |
| 78 | + console.log(` - Triggered by: ${actor}`); |
| 79 | + - name: Check out the repository |
| 80 | + uses: actions/checkout@v4 |
| 81 | + with: |
| 82 | + persist-credentials: false |
| 83 | + show-progress: false |
| 84 | + submodules: recursive |
| 85 | + - name: Set test-all inputs based on event specs |
| 86 | + run: | |
| 87 | + echo "submit=false" >> $GITHUB_ENV |
| 88 | + echo "generate=false" >> $GITHUB_ENV |
| 89 | + if [ "${{ github.event_name }}" == "schedule" ]; then |
| 90 | + echo "submit=true" >> $GITHUB_ENV |
| 91 | + elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then |
| 92 | + if [ "${{ inputs.bless }}" == "true" ]; then |
| 93 | + echo "generate=true" >> $GITHUB_ENV |
| 94 | + fi |
| 95 | + fi |
| 96 | + - name: Run tests |
| 97 | + uses: ./.github/actions/test-all-scream |
| 98 | + with: |
| 99 | + build_type: ${{ matrix.build_type }} |
| 100 | + machine: ghci-snl-cpu |
| 101 | + generate: ${{ env.generate }} |
| 102 | + submit: ${{ env.submit }} |
| 103 | + cmake-configs: Kokkos_ENABLE_OPENMP=ON |
| 104 | + # cuda: |
| 105 | + # # Disable until the CUDA container is up and running. When CUDA container is availabe, remove |
| 106 | + # # this line and uncomment the next if |
| 107 | + # if: false |
| 108 | + # # Runs always for pull_request. For workflow_dispatch, user must request this machine |
| 109 | + # # if: ${{ github.event_name == 'pull_request' || contains(github.event.inputs.jobs_to_run, 'openmp-gcc') }} |
| 110 | + # runs-on: [self-hosted, cuda] |
| 111 | + # strategy: |
| 112 | + # fail-fast: false |
| 113 | + # matrix: |
| 114 | + # build_type: [sp, dbg, fpe, opt] |
| 115 | + # name: cuda-${{ matrix.build_type }} |
| 116 | + # steps: |
| 117 | + # - name: Show action trigger |
| 118 | + # uses: ./.github/actions/print-workflow-trigger |
| 119 | + # - name: Check out the repository |
| 120 | + # uses: actions/checkout@v4 |
| 121 | + # with: |
| 122 | + # persist-credentials: false |
| 123 | + # show-progress: false |
| 124 | + # submodules: recursive |
| 125 | + # - name: Run tests |
| 126 | + # uses: ./.github/actions/test-all-scream |
| 127 | + # with: |
| 128 | + # build_type: ${{ matrix.build_type }} |
| 129 | + # machine: ghci-snl-cuda |
| 130 | + # run_type: at-run |
0 commit comments