|
| 1 | +name: EAMxx standalone testing |
| 2 | +description: | |
| 3 | + Run EAMxx standalone testing with required configuration inputs. |
| 4 | + More precisely, it launches test-all-scream with the proper flags. |
| 5 | + See components/eamxx/scripts/test-all-scream for more details. |
| 6 | + The configuration inputs are: |
| 7 | + - build_type: the type of build to pass to test-all-scream. |
| 8 | + - machine: the name of the machine to pass to test-all-scream |
| 9 | + - generate: whether to generate baselines |
| 10 | + - submit: whether to submit to cdash (unused if generate is 'true') |
| 11 | +
|
| 12 | +inputs: |
| 13 | + build_type: |
| 14 | + description: 'Build type to run' |
| 15 | + required: true |
| 16 | + machine: |
| 17 | + description: 'Machine name for test-all-scream' |
| 18 | + required: true |
| 19 | + generate: |
| 20 | + description: 'Generate baselines instead of running tests' |
| 21 | + required: true |
| 22 | + default: 'false' |
| 23 | + valid_values: |
| 24 | + - 'true' |
| 25 | + - 'false' |
| 26 | + submit: |
| 27 | + description: 'Submit results to cdash (unused if generate=true)' |
| 28 | + required: true |
| 29 | + default: 'false' |
| 30 | + valid_values: |
| 31 | + - 'true' |
| 32 | + - 'false' |
| 33 | + cmake-configs: |
| 34 | + description: 'Semicolon-separated list of key=value pairs for CMake to pass to test-all-scream' |
| 35 | + required: false |
| 36 | + default: '' |
| 37 | + |
| 38 | +runs: |
| 39 | + using: "composite" |
| 40 | + steps: |
| 41 | + - name: Set CA certificates env var |
| 42 | + run: | |
| 43 | + # Ensure the operating system is Linux |
| 44 | + if [ "$(uname)" != "Linux" ]; then |
| 45 | + echo "This action only supports Linux." |
| 46 | + exit 1 |
| 47 | + fi |
| 48 | + # Set env var to be used in upload-artifacts phase |
| 49 | + if [ -f /etc/debian_version ]; then |
| 50 | + echo "NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt" >> $GITHUB_ENV |
| 51 | + elif [ -f /etc/redhat-release ] || [ -f /etc/centos-release ] || [ -f /etc/fedora-release ]; then |
| 52 | + echo "NODE_EXTRA_CA_CERTS=/etc/pki/tls/certs/ca-bundle.crt" >> $GITHUB_ENV |
| 53 | + else |
| 54 | + echo "Unsupported Linux distribution" |
| 55 | + exit 1 |
| 56 | + fi |
| 57 | + shell: sh |
| 58 | + - name: Check repo presence |
| 59 | + run: | |
| 60 | + if [ ! -d ".git" ]; then |
| 61 | + echo "Repository is not checked out. Please ensure the repository is checked out before running this action." |
| 62 | + exit 1 |
| 63 | + fi |
| 64 | + shell: sh |
| 65 | + - name: Print build specs |
| 66 | + run: | |
| 67 | + echo "Testing EAMxx standalone, for the following configuration:" |
| 68 | + echo " build type : ${{ inputs.build_type }}" |
| 69 | + echo " machine : ${{ inputs.machine }}" |
| 70 | + echo " generate : ${{ inputs.generate }}" |
| 71 | + echo " submit : ${{ inputs.submit }}" |
| 72 | + echo " cmake-configs: ${{ inputs.cmake-configs }}" |
| 73 | + shell: sh |
| 74 | + - name: Run test-all-scream |
| 75 | + working-directory: components/eamxx |
| 76 | + run: | |
| 77 | + cmd="./scripts/test-all-scream -m ${{ inputs.machine }} -t ${{inputs.build_type}} --baseline-dir AUTO -c EKAT_DISABLE_TPL_WARNINGS=ON" |
| 78 | + if [ "${{ inputs.generate }}" = "true" ]; then |
| 79 | + cmd+=" -g" |
| 80 | + elif [ "${{ inputs.submit }}" = "true" ]; then |
| 81 | + cmd+=" -s" |
| 82 | + fi |
| 83 | +
|
| 84 | + # If cmake-configs is non-empty, add tokens to test-all-scream via "-c key=val" |
| 85 | + IFS=';' read -ra configs <<< "${{ inputs.cmake-configs }}" |
| 86 | + for config in "${configs[@]}"; do |
| 87 | + cmd+=" -c $config" |
| 88 | + done |
| 89 | +
|
| 90 | + # Print the full command, then run it |
| 91 | + echo "test-all-scream call: $cmd" |
| 92 | + $cmd |
| 93 | + shell: sh |
| 94 | + - name: Upload ctest logs |
| 95 | + if: always() |
| 96 | + uses: actions/upload-artifact@v4 |
| 97 | + with: |
| 98 | + name: log-files-${{ inputs.build_type }}-${{ inputs.machine }} |
| 99 | + path: | |
| 100 | + components/eamxx/ctest-build/*/Testing/Temporary/Last*.log |
| 101 | + components/eamxx/ctest-build/*/ctest_resource_file.json |
| 102 | + components/eamxx/ctest-build/*/CMakeCache.txt |
| 103 | + env: |
| 104 | + NODE_EXTRA_CA_CERTS: ${{ env.NODE_EXTRA_CA_CERTS }} |
0 commit comments