-
Notifications
You must be signed in to change notification settings - Fork 1.8k
79 lines (74 loc) · 2.42 KB
/
build-and-test.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
name: Build and Tests
on: [ pull_request ]
defaults:
run:
shell: bash
jobs:
build:
name: build go binary
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: 1.22.5
- name: build
run: |
go build ./...
tests:
needs: [ build ]
name: test go
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: 1.22.5
- name: build
run: |
make test-unit-verbose-and-race
generated:
needs: [ build ]
name: check if generated code is up-to-date
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: 1.22.5
- name: generated
run: |
./hack/verify-codegen.sh
multi-arch-build:
needs: [ build ]
name: check if multi-arch build works
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: 1.22.5
- uses: ko-build/[email protected]
- name: ko-resolve
run: |
cat <<EOF > .ko.yaml
defaultBaseImage: cgr.dev/chainguard/static
baseImageOverrides:
# Use the combined base image for images that should include Windows support.
# NOTE: Make sure this list of images to use the combined base image is in sync with what's in tekton/publish.yaml's 'create-ko-yaml' Task.
github.com/tektoncd/pipeline/cmd/entrypoint: ghcr.io/tektoncd/pipeline/github.com/tektoncd/pipeline/combined-base-image:latest
github.com/tektoncd/pipeline/cmd/nop: ghcr.io/tektoncd/pipeline/github.com/tektoncd/pipeline/combined-base-image:latest
github.com/tektoncd/pipeline/cmd/workingdirinit: ghcr.io/tektoncd/pipeline/github.com/tektoncd/pipeline/combined-base-image:latest
github.com/tektoncd/pipeline/cmd/git-init: cgr.dev/chainguard/git
EOF
KO_DOCKER_REPO=example.com ko resolve -l 'app.kubernetes.io/component!=resolvers' --platform=all --push=false -R -f config 1>/dev/null
KO_DOCKER_REPO=example.com ko resolve --platform=all --push=false -f config/resolvers 1>/dev/null
e2e-tests:
needs:
- build
- tests
uses: ./.github/workflows/e2e-matrix.yml