generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (103 loc) · 2.6 KB
/
ci.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
100
101
102
103
name: main
on:
pull_request:
push:
branches:
- 'main'
tags-ignore:
- '*'
jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Test
run: make build
lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Lint
run: make lint
check-goreleaser-config:
name: Check goreleaser.yml
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: goreleaser/[email protected]
with:
version: v2.2.0
args: check -f .goreleaser.yml
test:
name: Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Test
run: make test
e2e:
name: End-to-End Tests
strategy:
matrix:
k8s-version: ["1.29.8", "1.30.4", "1.31.0"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: make start KUBERNETES_VERSION=${{ matrix.k8s-version }}
working-directory: e2e
- run: make test
working-directory: e2e
- run: make logs
working-directory: e2e
if: always()
- uses: actions/upload-artifact@v4
if: always()
with:
name: logs-${{ matrix.k8s-version }}.tar.gz
path: e2e/logs.tar.gz
dry-run:
name: Dry-run release
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Setup tag for goreleaser
run: |
echo "GORELEASER_CURRENT_TAG=$(git describe --tags --abbrev=0 --match "v*" || echo v0.0.0)" >> $GITHUB_ENV
- name: GoReleaser
uses: goreleaser/[email protected]
with:
version: v2.2.0
args: --snapshot --skip publish --clean
- name: Test built containers
run: make container-structure-test