diff --git a/.github/workflows/test_docker_debian.yml b/.github/workflows/test_docker_debian.yml index a4f98c44b..dc0fcb760 100644 --- a/.github/workflows/test_docker_debian.yml +++ b/.github/workflows/test_docker_debian.yml @@ -17,19 +17,15 @@ concurrency: jobs: - # Build container and run tests - run: - name: ${{ matrix.debian_codename }} - strategy: - fail-fast: false - matrix: - debian_codename: ['bullseye'] #['bookworm', 'bullseye', 'buster'] + # Build container and run tests. Duplication of job intended for better visualization. + run_bullseye: + name: 'bullseye' uses: ./.github/workflows/test_docker_debian_codename_sub.yml with: - runs_on: ubuntu-latest - platform: linux/arm/v7 - docker_image_name: rpi-jukebox-rfid-v3 - cache_scope: ${{ github.ref }}-test-debian-v3 - matrix_usernames: "['pi', 'hans']" - matrix_test_scripts: "['run_installation_tests.sh']" - debian_codename: ${{ matrix.debian_codename }} + debian_codename: 'bullseye' + + run_buster: + name: 'buster' + uses: ./.github/workflows/test_docker_debian_codename_sub.yml + with: + debian_codename: 'buster' diff --git a/.github/workflows/test_docker_debian_codename_sub.yml b/.github/workflows/test_docker_debian_codename_sub.yml index 12bc69645..e6bae0a0d 100644 --- a/.github/workflows/test_docker_debian_codename_sub.yml +++ b/.github/workflows/test_docker_debian_codename_sub.yml @@ -3,31 +3,25 @@ name: Subworkflow Test Install Scripts Debian V3 on: workflow_call: inputs: - runs_on: - required: true - type: string - platform: - required: true - type: string debian_codename: required: true type: string cache_scope: - required: true - type: string - docker_image_name: - required: true - type: string - matrix_usernames: - required: true - type: string - matrix_test_scripts: - required: true + required: false type: string + default: ${{ github.ref }}-test-debian-v3 local_registry_port: required: false type: number default: 5000 + runs_on: + required: false + type: string + default: ubuntu-latest + +env: + platform: linux/arm/v7 + docker_image_name: rpi-jukebox-rfid-v3 # let only one instance run the test so cache is not corrupted. # cancel already running instances as only the last run will be relevant @@ -69,7 +63,7 @@ jobs: id: pre-vars env: DEBIAN_CODENAME: ${{ inputs.debian_codename }} - DOCKER_IMAGE_NAME: ${{ inputs.docker_image_name }} + DOCKER_IMAGE_NAME: ${{ env.docker_image_name }} CACHE_SCOPE: ${{ inputs.cache_scope }} run: | echo "image_tag_name=${{ env.DOCKER_IMAGE_NAME }}:${{ env.DEBIAN_CODENAME }}-test" >> $GITHUB_OUTPUT @@ -97,7 +91,7 @@ jobs: push: true file: ./ci/ci-debian.Dockerfile target: test-code - platforms: ${{ inputs.platform }} + platforms: ${{ env.platform }} tags: ${{ steps.vars.outputs.image_tag_name_local_base }} cache-from: type=gha,scope=${{ steps.vars.outputs.cache_scope }} cache-to: type=gha,mode=max,scope=${{ steps.vars.outputs.cache_scope }} @@ -115,7 +109,7 @@ jobs: push: false file: ./ci/ci-debian.Dockerfile target: test-update - platforms: ${{ inputs.platform }} + platforms: ${{ env.platform }} tags: ${{ steps.vars.outputs.image_tag_name }} cache-from: type=gha,scope=${{ steps.vars.outputs.cache_scope }} # DON'T use 'cache-to' here as the layer is then cached and this build would be useless @@ -139,8 +133,8 @@ jobs: strategy: fail-fast: false matrix: - username: ${{ fromJSON(inputs.matrix_usernames) }} - test_script: ${{ fromJSON(inputs.matrix_test_scripts) }} + username: ['pi', 'hans'] + test_script: ['run_installation_tests.sh'] steps: - name: Set up QEMU @@ -163,7 +157,7 @@ jobs: uses: tj-actions/docker-run@v2 with: image: ${{ needs.build.outputs.image_tag_name }} - options: --platform ${{inputs.platform }} --user ${{ matrix.username }} + options: --platform ${{ env.platform }} --user ${{ matrix.username }} name: ${{ matrix.test_script }} args: | ./${{ matrix.test_script }}