Skip to content

Commit

Permalink
Add post processing to set nvcc-specific matrix outputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhemstad committed Jul 19, 2023
1 parent 8d09b5c commit 27f0e79
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: pr

defaults:
run:
shell: bash
shell: bash -euo pipefail {0}

on:
push:
Expand All @@ -21,14 +21,29 @@ jobs:
compute-nvcc-matrix:
name: Compute NVCC matrix
runs-on: ubuntu-latest
outputs:
CUDA_VERSIONS: ${{ steps.set-outputs.outputs.CUDA_VERSIONS }}
HOST_COMPILERS: ${{ steps.set-outputs.outputs.HOST_COMPILERS }}
PER_CUDA_COMPILER_MATRIX: ${{ steps.set-outputs.outputs.PER_CUDA_COMPILER_MATRIX }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Get full nvcc matrix
id: compute-nvcc-matrix
uses: ./.github/actions/compute-matrix
with:
matrix_file: './ci/matrix.yaml'
matrix_query: '.pull_request.nvcc'
- name: Set outputs
id: set-outputs
run: |
FULL_MATRIX=${{steps.compute-nvcc-matrix.outputs.matrix}}
CUDA_VERSIONS=$(echo $FULL_MATRIX | jq -c '[.[] | .cuda] | unique')
echo "CUDA_VERSIONS=$CUDA_VERSIONS" | tee -a "$GITHUB_OUTPUT"
HOST_COMPILERS=$(echo $FULL_MATRIX | jq -c '[.[] | .compiler.name] | unique')
echo "HOST_COMPILERS=$HOST_COMPILERS" | tee -a "$GITHUB_OUTPUT"
PER_CUDA_COMPILER_MATRIX=$(echo $FULL_MATRIX | jq -c ' group_by(.cuda + .compiler.name) | map({(.[0].cuda + "-" + .[0].compiler.name): .}) | add')
echo "PER_CUDA_COMPILER_MATRIX=$PER_CUDA_COMPILER_MATRIX" | tee -a "$GITHUB_OUTPUT"
thrust:
name: Thrust CUDA${{ matrix.cuda_version }} ${{ matrix.compiler }}
Expand All @@ -38,7 +53,7 @@ jobs:
fail-fast: false
matrix:
cuda_version: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.CUDA_VERSIONS) }}
compiler: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.COMPILERS) }}
compiler: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.HOST_COMPILERS) }}
with:
per_cuda_compiler_matrix: ${{ toJSON(fromJSON(needs.compute-nvcc-matrix.outputs.PER_CUDA_COMPILER_MATRIX)[ format('{0}-{1}', matrix.cuda_version, matrix.compiler) ]) }}
build_script: "./ci/build_thrust.sh"
Expand All @@ -52,7 +67,7 @@ jobs:
fail-fast: false
matrix:
cuda_version: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.CUDA_VERSIONS) }}
compiler: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.COMPILERS) }}
compiler: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.HOST_COMPILERS) }}
with:
per_cuda_compiler_matrix: ${{ toJSON(fromJSON(needs.compute-nvcc-matrix.outputs.PER_CUDA_COMPILER_MATRIX)[ format('{0}-{1}', matrix.cuda_version, matrix.compiler) ]) }}
build_script: "./ci/build_cub.sh"
Expand All @@ -66,7 +81,7 @@ jobs:
fail-fast: false
matrix:
cuda_version: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.CUDA_VERSIONS) }}
compiler: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.COMPILERS) }}
compiler: ${{ fromJSON(needs.compute-nvcc-matrix.outputs.HOST_COMPILERS) }}
with:
per_cuda_compiler_matrix: ${{ toJSON(fromJSON(needs.compute-nvcc-matrix.outputs.PER_CUDA_COMPILER_MATRIX)[ format('{0}-{1}', matrix.cuda_version, matrix.compiler) ]) }}
build_script: "./ci/build_libcudacxx.sh"
Expand Down

0 comments on commit 27f0e79

Please sign in to comment.