diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index db748dc03..74677ecdd 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -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} @@ -33,30 +34,45 @@ 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: + name: Get 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 }}" != "c++" ]; then + COMPILER_SEGMENT="${{ matrix.compiler.name }}${{ matrix.compiler.version }}-" + fi + DEVCONTAINER_IMAGE="rapidsai/devcontainers:${{inputs.devcontainer_version}}-cpp-${COMPILER_SEGMENT}cuda${{inputs.cuda_version}}-${{inputs.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}}" \ No newline at end of file diff --git a/.github/workflows/dispatch-build-and-test.yml b/.github/workflows/dispatch-build-and-test.yml index 2994d678b..dea71e00e 100644 --- a/.github/workflows/dispatch-build-and-test.yml +++ b/.github/workflows/dispatch-build-and-test.yml @@ -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 }} @@ -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}} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2ca22369f..a4e30ec92 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -32,7 +32,6 @@ concurrency: cancel-in-progress: true jobs: - get-devcontainer-version: name: Get devcontainer version runs-on: ubuntu-latest diff --git a/ci/matrix.yml b/ci/matrix.yml index 32e46420f..967cec68d 100644 --- a/ci/matrix.yml +++ b/ci/matrix.yml @@ -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']} \ No newline at end of file + - {cuda: *cuda_oldest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'cc', version: '', exe: 'c++'}, 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']} \ No newline at end of file