Skip to content

Commit

Permalink
Extent matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeepyjack committed Aug 18, 2023
1 parent 7099dd7 commit 186b986
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ defaults:
on:
workflow_call:
inputs:
devcontainer_version: {type: string, required: true}
cuda_version: {type: string, required: true}
compiler: {type: string, required: true}
compiler_exe: {type: string, required: true}
Expand All @@ -33,30 +34,44 @@ on:
build_script: {type: string, required: false}
test_script: {type: string, required: false}
run_tests: {type: boolean, required: false, default: true}
build_image: {type: string, required: false}
test_image: {type: string, required: false}

jobs:
devcontainer_image:
runs-on: ubuntu-latest
outputs:
image_name: ${{ steps.compute-devcontainer-image-name.outputs.name }}
steps:
- name: Compute devcontainer image name
id: compute-devcontainer-image-name
run: |
COMPILER_SEGMENT=""
if [ "${{ matrix.compiler_version }}" != "" ]; then
COMPILER_SEGMENT="${{ matrix.compiler.name }}${{ matrix.compiler.version }}-"
fi
DEVCONTAINER_IMAGE="rapidsai/devcontainers:${{inputs.devcontainer_version}}-cpp-$COMPILER_SEGMENTcuda${{matrix.cuda_version}}-${{matrix.os}}"
echo "::set-output name=name::$DEVCONTAINER_IMAGE"
build:
if: inputs.build_script != '' && inputs.build_image != ''
needs: devcontainer_image
if: inputs.build_script != '' && needs.devcontainer_image.outputs.image_name != ''
name: Build ${{inputs.compiler}}${{inputs.compiler_version}}/C++${{inputs.std}}
uses: ./.github/workflows/run-as-coder.yml
with:
name: Build ${{inputs.compiler}}${{inputs.compiler_version}}/C++${{inputs.std}}
runner: linux-${{inputs.cpu}}-cpu16
image: ${{inputs.build_image}}
image: ${{ needs.devcontainer_image.outputs.image_name }}
command: |
${{ inputs.build_script }} "${{inputs.compiler_exe}}" "${{inputs.std}}" "${{inputs.gpu_build_archs}}"
test:
needs: build
if: ${{ !cancelled() && ( needs.build.result == 'success' || needs.build.result == 'skipped' ) && inputs.test_script != '' && inputs.test_image != '' && inputs.run_tests}}
needs: [devcontainer_image, build]
if: ${{ !cancelled() && ( needs.build.result == 'success' || needs.build.result == 'skipped' ) && inputs.test_script != '' && needs.devcontainer_image.outputs.image_name != '' && inputs.run_tests}}
name: Test ${{inputs.compiler}}${{inputs.compiler_version}}/C++${{inputs.std}}
uses: ./.github/workflows/run-as-coder.yml
with:
name: Test ${{inputs.compiler}}${{inputs.compiler_version}}/C++${{inputs.std}}
runner: linux-${{inputs.cpu}}-gpu-v100-latest-1
image: ${{inputs.test_image}}
image: ${{ needs.devcontainer_image.outputs.image_name }}
command: |
nvidia-smi
${{ inputs.test_script }} "${{inputs.compiler_exe}}" "${{inputs.std}}" "${{inputs.gpu_build_archs}}"
3 changes: 1 addition & 2 deletions .github/workflows/dispatch-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
matrix:
include: ${{ fromJSON(inputs.per_cuda_compiler_matrix) }}
with:
devcontainer_version: ${{ inputs.devcontainer_version }}
cuda_version: ${{ matrix.cuda }}
compiler: ${{ matrix.compiler.name }}
compiler_exe: ${{ matrix.compiler.exe }}
Expand All @@ -44,7 +45,5 @@ jobs:
cpu: ${{ matrix.cpu }}
os: ${{ matrix.os }}
build_script: ${{ inputs.build_script }}
build_image: rapidsai/devcontainers:${{inputs.devcontainer_version}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}}
test_script: ${{ inputs.test_script }}
run_tests: ${{ contains(matrix.jobs, 'test') && !contains(github.event.head_commit.message, 'skip-tests') }}
test_image: rapidsai/devcontainers:${{inputs.devcontainer_version}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}}
1 change: 0 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ concurrency:
cancel-in-progress: true

jobs:

get-devcontainer-version:
name: Get devcontainer version
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion ci/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ devcontainer_version: '23.08'
# Configurations that will run for every PR
pull_request:
nvcc:
- {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'gcc', version: '12', exe: 'g++'}, gpu_build_archs: '70', std: [17], jobs: ['build', 'test']}
- {cuda: *cuda_oldest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'gcc', version: '', exe: 'g++'}, gpu_build_archs: '60', std: [17], jobs: ['build', 'test']}
- {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'gcc', version: '12', exe: 'g++'}, gpu_build_archs: '70', std: [17], jobs: ['build', 'test']}
- {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'gcc', version: '12', exe: 'g++'}, gpu_build_archs: '80;90', std: [17], jobs: ['build']}

0 comments on commit 186b986

Please sign in to comment.