-
Notifications
You must be signed in to change notification settings - Fork 12
116 lines (112 loc) · 3.46 KB
/
e2e.yml
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
104
105
106
107
108
109
110
111
112
113
114
115
116
name: e2e
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
paths-ignore:
- 'doc/**'
permissions:
contents: read
pull-requests: read
jobs:
golangci:
name: golangci
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go command
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
skip-build-cache: true
skip-pkg-cache: true
verify:
name: verify
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go command
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: make verify
run: make verify
ci:
needs:
- verify
- golangci
name: ci test for k8s
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: true
matrix:
k8s-version:
- v1.21.14
- v1.22.13
- v1.23.10
- v1.24.4
- v1.25.0
env:
K8S_VERSION: "${{ matrix.k8s-version }}"
LOG_DIR: "/tmp/arbiter/logs"
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go command
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Install ginkgo
run: |
version=$(cat go.mod| grep "ginkgo/v2" | awk '{print $2}')
go install -v github.com/onsi/ginkgo/v2/ginkgo@$version
# Github action will pre-install close to the latest version of Kind,
# but in our tests, to upgrade the kind version, it is best to verify that the old kubernetes node image is available
# in the new version of Kind, and it is best to use the updated kubernetes node image provided by the new version of kind.
# see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#preinstalled-software
# for more info.
- name: Install kind v0.15.0
run: go install sigs.k8s.io/kind@v0.15.0
- name: Install kubectl
run: |
curl -LO https://storage.googleapis.com/kubernetes-release/release/${{ matrix.k8s-version }}/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
# Github action will be pre-installed with the latest version of Helm, our test does not limit the version of Helm.
# see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#preinstalled-software
# for more info.
# - name: Install helm
# run: |
# curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- name: E2E Test
timeout-minutes: 60
run: |
bash tests/prepare-k8s.sh
bash tests/install-infra.sh
cd tests/e2e
ginkgo -vv
- name: Export logs
if: failure()
run: bash tests/export-logs.sh
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: log-${{ matrix.k8s-version }}
path: ${{ env.LOG_DIR }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true