|
| 1 | +name: ghci-snl-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 | + |
| 9 | + # Manual run is used to bless |
| 10 | + workflow_dispatch: |
| 11 | + inputs: |
| 12 | + job_to_run: |
| 13 | + description: 'Job to run' |
| 14 | + required: true |
| 15 | + type: choice |
| 16 | + options: |
| 17 | + - gcc-openmp |
| 18 | + - gcc-cuda |
| 19 | + - all |
| 20 | + |
| 21 | + # Add schedule trigger for nightly runs at midnight MT (Standard Time) |
| 22 | + schedule: |
| 23 | + - cron: '0 7 * * *' # Runs at 7 AM UTC, which is midnight MT during Standard Time |
| 24 | + |
| 25 | +concurrency: |
| 26 | + # Two runs are in the same group if they are testing the same git ref |
| 27 | + # - if trigger=pull_request, the ref is refs/pull/<PR_NUMBER>/merge |
| 28 | + # - for other triggers, the ref is the branch tested |
| 29 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 30 | + cancel-in-progress: true |
| 31 | + |
| 32 | +jobs: |
| 33 | + gcc-openmp: |
| 34 | + if: | |
| 35 | + ${{ |
| 36 | + github.event_name != 'workflow_dispatch' || |
| 37 | + ( |
| 38 | + github.event.inputs.job_to_run == 'gcc-openmp' || |
| 39 | + github.event.inputs.job_to_run == 'all' |
| 40 | + ) |
| 41 | + }} |
| 42 | + runs-on: [self-hosted, ghci-snl-cpu, gcc] |
| 43 | + strategy: |
| 44 | + fail-fast: false |
| 45 | + matrix: |
| 46 | + build_type: [debug, release] |
| 47 | + name: gcc-openmp / ${{ matrix.build_type }} |
| 48 | + steps: |
| 49 | + - name: Check out the repository |
| 50 | + uses: actions/checkout@v4 |
| 51 | + with: |
| 52 | + persist-credentials: false |
| 53 | + show-progress: false |
| 54 | + submodules: recursive |
| 55 | + - name: Show action trigger |
| 56 | + uses: ./.github/actions/show-workflow-trigger |
| 57 | + - name: Ensure CACTS is installed |
| 58 | + run: | |
| 59 | + python3 -m pip install --user --upgrade --trusted-host pypi.org cacts |
| 60 | + - name: Run tests |
| 61 | + run: | |
| 62 | + cmd="cacts -m ghci-snl-hip -t ${{ matrix.test.build_type }} -r ./" |
| 63 | + echo "CACTS call: $cmd" |
| 64 | + $cmd |
| 65 | + - name: Upload files |
| 66 | + if: always() |
| 67 | + uses: actions/upload-artifact@v4 |
| 68 | + with: |
| 69 | + name: log-files-${{ matrix.test.build_type }}-ghci-snl-cpu |
| 70 | + path: | |
| 71 | + ctest-build/*/Testing/Temporary/Last*.log |
| 72 | + ctest-build/*/ctest_resource_file.json |
| 73 | + ctest-build/*/ctest_script.cmake |
| 74 | + ctest-build/*/CMakeCache.txt |
| 75 | + gcc-cuda: |
| 76 | + if: | |
| 77 | + ${{ |
| 78 | + github.event_name != 'workflow_dispatch' || |
| 79 | + ( |
| 80 | + github.event.inputs.job_to_run == 'gcc-cuda' || |
| 81 | + github.event.inputs.job_to_run == 'all' |
| 82 | + ) |
| 83 | + }} |
| 84 | + runs-on: [self-hosted, ghci-snl-cuda, cuda, gcc] |
| 85 | + strategy: |
| 86 | + fail-fast: false |
| 87 | + matrix: |
| 88 | + build_type: [debug, release] |
| 89 | + name: gcc-cuda / ${{ matrix.build_type }} |
| 90 | + steps: |
| 91 | + - name: Check out the repository |
| 92 | + uses: actions/checkout@v4 |
| 93 | + with: |
| 94 | + persist-credentials: false |
| 95 | + show-progress: false |
| 96 | + submodules: recursive |
| 97 | + - name: Show action trigger |
| 98 | + uses: ./.github/actions/show-workflow-trigger |
| 99 | + - name: Get CUDA Arch |
| 100 | + run: | |
| 101 | + # Ensure nvidia-smi is available |
| 102 | + if ! command -v nvidia-smi &> /dev/null; then |
| 103 | + echo "nvidia-smi could not be found. Please ensure you have Nvidia drivers installed." |
| 104 | + exit 1 |
| 105 | + fi |
| 106 | +
|
| 107 | + # Get the GPU model from nvidia-smi, and set env for next step |
| 108 | + gpu_model=$(nvidia-smi --query-gpu=name --format=csv,noheader | head -n 1) |
| 109 | + case "$gpu_model" in |
| 110 | + *"H100"*) |
| 111 | + echo "ARCH=Hopper" >> $GITHUB_ENV |
| 112 | + ;; |
| 113 | + *"A100"*) |
| 114 | + echo "ARCH=Ampere80" >> $GITHUB_ENV |
| 115 | + ;; |
| 116 | + *"V100"*) |
| 117 | + echo "ARCH=Volta70" >> $GITHUB_ENV |
| 118 | + ;; |
| 119 | + *) |
| 120 | + echo "Unsupported GPU model: $gpu_model" |
| 121 | + exit 1 |
| 122 | + ;; |
| 123 | + esac |
| 124 | + - name: Ensure CACTS is installed |
| 125 | + run: | |
| 126 | + python3 -m pip install --user --upgrade --trusted-host pypi.org cacts |
| 127 | + - name: Run tests |
| 128 | + run: | |
| 129 | + cmd="cacts -m ghci-snl-hip -t ${{ matrix.test.build_type }} -r ./ -c Kokkos_ARCH_${{ env.ARCH }}=ON" |
| 130 | + echo "CACTS call: $cmd" |
| 131 | + $cmd |
| 132 | + - name: Upload files |
| 133 | + if: always() |
| 134 | + uses: actions/upload-artifact@v4 |
| 135 | + with: |
| 136 | + name: log-files-${{ matrix.build_type }}-ghci-snl-cuda |
| 137 | + path: | |
| 138 | + ctest-build/*/Testing/Temporary/Last*.log |
| 139 | + ctest-build/*/ctest_resource_file.json |
| 140 | + ctest-build/*/ctest_script.cmake |
| 141 | + ctest-build/*/CMakeCache.txt |
0 commit comments