-
Notifications
You must be signed in to change notification settings - Fork 37
99 lines (84 loc) · 2.18 KB
/
pr_build.yaml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: PR Build
on:
pull_request: {}
workflow_dispatch: {}
env:
GO_VERSION: 1.20.1
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Lint
run: make lint
unit-test:
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Run unit tests
run: make test
build-image:
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build image
run: make docker-build
- name: Export images
run: tar -czvf images.tar.gz *-image.tar
- name: Archive image
uses: actions/[email protected]
with:
name: images
path: images.tar.gz
test-image:
runs-on: ubuntu-22.04
needs: [unit-test, build-image]
permissions:
contents: read
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install regctl
uses: regclient/actions/regctl-installer@main
- name: Download archived image
uses: actions/[email protected]
with:
name: images
path: .
- name: Load archived images
run: |
tar xvf images.tar.gz
make load-images
- name: Test image
run: |
docker tag ghcr.io/spiffe/spire-controller-manager:devel ghcr.io/spiffe/spire-controller-manager:nightly
(cd demo; ./test.sh)
success:
runs-on: ubuntu-22.04
needs: [lint, unit-test, build-image, test-image]
steps:
- name: Shout it out
run: echo SUCCESS