-
Notifications
You must be signed in to change notification settings - Fork 874
98 lines (94 loc) · 2.87 KB
/
e2e.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: E2E Tests
on:
push:
branches:
- 'master'
- 'release-*'
pull_request:
branches:
- 'master'
- 'release-*'
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Event File
path: ${{ github.event_path }}
test-e2e:
strategy:
fail-fast: false
matrix:
kubernetes-minor-version:
- 1.23
- 1.24
- 1.25
- 1.26
name: Run end-to-end tests
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4.1.0
with:
go-version: '1.20'
- uses: actions/checkout@v4
- name: Setup k3s
env:
INSTALL_K3S_CHANNEL: v${{ matrix.kubernetes-minor-version }}
run: |
curl -sfL https://get.k3s.io | sh -
sudo mkdir ~/.kube
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chmod 755 ~/.kube/config
kubectl version
kubectl create ns argo-rollouts
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download cache
run: go mod download
- name: Install CRDs
run: |
kubectl apply -k manifests/crds
kubectl apply -f test/e2e/crds
- name: Start controller
run: make start-e2e 2>&1 | sed -r "s/[[:cntrl:]]\[[0-9]{1,3}m//g" > /tmp/e2e-controller.log &
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true'}}
- name: Run e2e tests
run: make test-e2e
if: ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true') }}
- name: Output Rerun Overview
run: |
[[ -f rerunreport.txt ]] && cat rerunreport.txt || echo "No rerun report found"
- name: Upload E2E Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: E2E Test Results (k8s ${{ matrix.kubernetes-minor-version }})
path: |
junit.xml
- name: Upload e2e-controller logs
uses: actions/upload-artifact@v3
with:
name: e2e-controller-k8s-${{ matrix.kubernetes-minor-version }}.log
path: /tmp/e2e-controller.log
if: ${{ failure() }}