Build containers #84
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Build images | |
| on: | |
| workflow_dispatch: {} | |
| pull_request: {} | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| contents: read | |
| jobs: | |
| setup_matrix: | |
| runs-on: ubuntu-24.04 | |
| name: Setup Matrix | |
| outputs: | |
| puppet_beaker_test_matrix: ${{ steps.get-outputs.outputs.puppet_beaker_test_matrix }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Ruby ${{ matrix.ruby }} | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "4.0" | |
| bundler-cache: true | |
| - name: Setup Test Matrix | |
| id: get-outputs | |
| run: bundle exec metadata2gha | |
| beaker: | |
| needs: setup_matrix | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| packages: write # required to publish to the github container registry | |
| env: | |
| BEAKER_HYPERVISOR: podman | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{fromJson(needs.setup_matrix.outputs.puppet_beaker_test_matrix)}} | |
| name: "${{ matrix.name }}" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '4.0' | |
| bundler-cache: true | |
| - name: Display Ruby environment | |
| run: bundle env | |
| - name: Run beaker | |
| run: bundle exec beaker-docker containerfile ${{ matrix.env.BEAKER_SETFILE }} | |
| env: ${{ matrix.env }} | |
| - name: Output Containerfile | |
| run: cat Containerfile | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build | |
| uses: docker/build-push-action@v7.1.0 | |
| with: | |
| context: . | |
| file: Containerfile | |
| #provenance: true | |
| push: false | |
| sbom: true | |
| platforms: linux/amd64 | |
| load: true # makes the image available to the running docker service | |
| tags: latest | |
| tests: | |
| if: always() | |
| needs: | |
| - setup_matrix | |
| - beaker | |
| runs-on: ubuntu-24.04 | |
| name: Test suite | |
| steps: | |
| - name: Decide whether the needed jobs succeeded or failed | |
| uses: re-actors/alls-green@release/v1 | |
| with: | |
| jobs: ${{ toJSON(needs) }} |