-
Notifications
You must be signed in to change notification settings - Fork 69
96 lines (94 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
name: Backup Restore CI
permissions:
contents : read
on:
workflow_call:
push:
branches:
- main
- release/v[0-9]+.(0|x)
- release/v[0-9]+.[0-9]+.[0-9]+
paths-ignore:
- 'docs/**'
- '*.md'
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60.2
build:
strategy:
matrix:
arch:
- x64
- arm64
name : build
runs-on : runs-on,image=ubuntu22-full-${{ matrix.arch }},runner=4cpu-linux-${{ matrix.arch }},run-id=${{ github.run_id }}
outputs:
k3sversions: ${{ steps.support.outputs.k3sversions }}
steps:
- name : Checkout repository
uses : actions/checkout@v4
with :
fetch-depth : 0
- name: Install go
uses: actions/setup-go@v5
with:
go-version: 1.23
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name : Install helm
run : ./.github/workflows/scripts/install-helm.sh
- name : CI
run : make ci
test:
name : integration-test
runs-on : runs-on,image=ubuntu22-full-${{ matrix.arch }},runner=4cpu-linux-${{ matrix.arch }},run-id=${{ github.run_id }}
strategy:
matrix:
arch:
- x64
- arm64
#FIXME: temporarily hardcoded
K3S_VERSION :
- v1.28.1-k3s1
- v1.31.0-k3s1
steps:
- name : Checkout repository
uses : actions/checkout@v4
- name: Install go
uses: actions/setup-go@v5
with:
go-version: 1.23
- name : Install helm
run : ./.github/workflows/scripts/install-helm.sh
- name : Setup helm charts
run : ./scripts/package-helm
- name : Debug
run : ls -R ./dist/artifacts
- name : Install k3d
run : ./.github/workflows/scripts/install-k3d.sh
- name : Setup test environment
run : CLUSTER_NAME=backup-restore K3S_VERSION=${{ matrix.K3S_VERSION }} ./scripts/testenv
- name : Run e2e tests
run :
CLUSTER_NAME=backup-restore K3S_VERSION=${{ matrix.K3S_VERSION }} ./scripts/testenv
cd e2e && KUBECONFIG=$KUBECONFIG CHART_NAMESPACE=cattle-resources-system go test -v -timeout 10m -count=1 ./...