Skip to content

Commit

Permalink
Merge pull request #440 from eitsupi/update-script-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi committed May 2, 2022
2 parents 4ca51b8 + 9c0448b commit a3289e3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/scripts-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,31 @@ jobs:
needs: generate_matrix
runs-on: ubuntu-latest
strategy:
fail-fast: true
fail-fast: false
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Prepare build
id: prep
run: |
test_name="${{ matrix.base_image }}-${{ matrix.tag }}-${{ matrix.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 }}
--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
5 changes: 3 additions & 2 deletions tests/rocker_scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG tag=latest
FROM rocker/r-ver:${tag}
ARG base_image="rocker/r-ver"
ARG tag="latest"
FROM ${base_image}:${tag}

COPY tests/rocker_scripts/test.sh /test.sh
COPY scripts /rocker_scripts
Expand Down
6 changes: 6 additions & 0 deletions tests/rocker_scripts/matrix.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"base_image": [
"rocker/r-ver"
],
"tag": [
"4.0.0",
"latest"
Expand All @@ -17,16 +20,19 @@
],
"include": [
{
"base_image": "rocker/r-ver",
"tag": "4.0.0",
"script_name": "install_rstudio.sh",
"script_arg": "1.3.959"
},
{
"base_image": "rocker/r-ver",
"tag": "latest",
"script_name": "install_pandoc.sh",
"script_arg": "2.18"
},
{
"base_image": "rocker/r-ver",
"tag": "latest",
"script_name": "install_quarto.sh",
"script_arg": "0.9.260"
Expand Down

0 comments on commit a3289e3

Please sign in to comment.