-
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (78 loc) · 2.1 KB
/
build.yml
File metadata and controls
83 lines (78 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
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) }}