This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
98 lines (92 loc) · 2.26 KB
/
pull-request.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
name: Pull request
on:
- pull_request
jobs:
get-tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get tag
id: tag
run: echo "tag=$(git rev-parse --short=7 HEAD)" >> "$GITHUB_OUTPUT"
test:
runs-on: ubuntu-latest
needs: [get-tag]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Go vet
run: |
make vet
- name: Unit tests
run: |
make test
build:
runs-on: ubuntu-latest
needs: [get-tag]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
run: |
export VERSION=${{needs.get-tag.outputs.tag}}
make build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: manager
path: ./bin/manager
package-operator:
runs-on: ubuntu-latest
needs: [get-tag]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache melange
uses: actions/cache@v4
with:
path: |
build/.melange-cache
key: melange-cache
- name: Setup melange
uses: chainguard-dev/actions/setup-melange@main
- name: Build melange package
run: |
export VERSION=${{needs.get-tag.outputs.tag}}
export MELANGE_CONFIG=deploy/melange.tmpl.yaml
make melange-build
- name: Build apko image
run: |
export VERSION=${{needs.get-tag.outputs.tag}}
export IMAGE=ttl.sh/embedded-cluster-operator-image:dev-${VERSION}
export APKO_CONFIG=deploy/apko.tmpl.yaml
make apko apko-build-and-publish
check-crds:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Make Manifests
run: make manifests
- name: Check CRDs
run: |
git diff --exit-code --name-only
if [ $? -eq 0 ]; then
echo "CRDs are up to date"
else
echo "CRDs are out of date"
exit 1
fi