Skip to content

Commit

Permalink
can we test cuda successfully seperately?
Browse files Browse the repository at this point in the history
  • Loading branch information
cboettig committed Jan 31, 2024
1 parent 586739a commit 6b8ac78
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/cuda-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: test for rocker scripts

on:
pull_request:
branches:
- master
paths:
- tests/rocker_scripts/Dockerfile
- tests/rocker_scripts/cuda_matrix.json
- tests/rocker_scripts/test.sh
- scripts/*.sh
- "!scripts/install_R_*.sh"
- "!scripts/setup_R.sh"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
generate_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: |
CONTENT=$(jq 'tostring' -r tests/rocker_scripts/cuda_matrix.json)
echo ::set-output name=matrix::"${CONTENT}"
echo "${CONTENT}"
build:
needs: generate_matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Prepare build
id: prep
run: |
lower_script_name=$(echo ${{ matrix.script_name }} | tr '[:upper:]' '[:lower:]')
test_name="${{ matrix.base_image }}-${{ matrix.tag }}-${lower_script_name}-${{ matrix.script_arg }}"
echo ::set-output name=output_tag::"${test_name/"/"/"-"}"
- name: test build
run: |
docker buildx build . -f tests/rocker_scripts/Dockerfile \
--output=type=docker \
--build-arg base_image=${{ matrix.base_image }} \
--build-arg tag=${{ matrix.tag }} \
--build-arg script_name=${{ matrix.script_name }} \
--build-arg script_arg=${{ matrix.script_arg }} \
--tag ${{ steps.prep.outputs.output_tag }}
- name: inspect image
run: |
make inspect-image/"${{ steps.prep.outputs.output_tag }}"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: tmp
path: tmp
21 changes: 21 additions & 0 deletions tests/rocker_scripts/cuda_matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"base_image": [
"rocker/cuda"
],
"tag": [
"latest"
],
"script_name": [
"install_rstudio.sh"
],
"script_arg": [
"none"
],
"include": [
{
"base_image": "rocker/cuda",
"tag": "4.0.0",
"script_name": "install_rstudio.sh"
}
]
}

0 comments on commit 6b8ac78

Please sign in to comment.