-
Notifications
You must be signed in to change notification settings - Fork 20
136 lines (136 loc) · 4.21 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: CI
on:
pull_request:
push:
branches:
- 'main'
defaults:
run:
working-directory: v2
env:
go-version: "1.22"
cache-version: 1
jobs:
test:
name: Small test
strategy:
matrix:
test-ipam: ["true", "false"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go-version }}
cache-dependency-path: "**/go.sum"
- name: Cache tools
id: cache-tools
uses: actions/cache@v4
with:
path: |
v2/bin
v2/include
key: cache-${{ env.cache-version }}-go-${{ env.go-version }}-${{ hashFiles('v2/Makefile') }}
- run: make setup TEST_IPAM=${{ matrix.test-ipam }} TEST_EGRESS=true
if: steps.cache-tools.outputs.cache-hit != 'true'
- run: make test
- run: make test-nodenet
timeout-minutes: 10
- run: make test-founat
timeout-minutes: 10
- run: make check-generate
e2e:
name: End-to-end Test
strategy:
matrix:
kindest-node: ["1.27.13", "1.28.9", "1.29.4"]
ip-version: ["ipv4", "ipv6"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go-version }}
cache-dependency-path: "**/go.sum"
- run: make image
- run: make certs
- name: Enable docker IPv6 mode
if: matrix.ip-version == 'ipv6'
working-directory: v2/e2e
run: |
sudo mkdir -p /etc/docker
sudo cp daemon.json /etc/docker/daemon.json
sudo systemctl restart docker.service
sleep 10
echo TEST_IPV6=true >> $GITHUB_ENV
- run: make start KUBERNETES_VERSION=${{ matrix.kindest-node }}
working-directory: v2/e2e
- run: make install-coil
working-directory: v2/e2e
- run: make test TEST_IPAM=true TEST_EGRESS=true TEST_IPV6=false
if: matrix.ip-version == 'ipv4'
working-directory: v2/e2e
- run: make test TEST_IPAM=true TEST_EGRESS=true TEST_IPV6=true
if: matrix.ip-version == 'ipv6'
working-directory: v2/e2e
- run: make logs
working-directory: v2/e2e
if: always()
- uses: actions/upload-artifact@v4
if: always()
with:
name: logs-${{ matrix.ip-version }}-${{ matrix.kindest-node }}.tar.gz
path: v2/e2e/logs.tar.gz
e2e-egress:
name: End-to-end Test - Egress Only
strategy:
matrix:
kindest-node: ["1.27.13", "1.28.9", "1.29.4"]
ip-version: ["ipv4", "ipv6"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go-version }}
cache-dependency-path: "**/go.sum"
- run: make image
- run: make certs
- name: Enable docker IPv6 mode
if: matrix.ip-version == 'ipv6'
working-directory: v2/e2e
run: |
sudo mkdir -p /etc/docker
sudo cp daemon.json /etc/docker/daemon.json
sudo systemctl restart docker.service
sleep 10
echo TEST_IPV6=true >> $GITHUB_ENV
- run: make start KUBERNETES_VERSION=${{ matrix.kindest-node }} WITH_KINDNET=true TEST_IPV6=false
if: matrix.ip-version == 'ipv4'
working-directory: v2/e2e
- run: make start KUBERNETES_VERSION=${{ matrix.kindest-node }} WITH_KINDNET=true TEST_IPV6=true
if: matrix.ip-version == 'ipv6'
working-directory: v2/e2e
- run: make install-coil-egress-v4
if: matrix.ip-version == 'ipv4'
working-directory: v2/e2e
- run: make install-coil-egress-v6
if: matrix.ip-version == 'ipv6'
working-directory: v2/e2e
- run: docker exec -i coil-worker ls /etc/cni/net.d/
working-directory: v2/e2e
if: always()
- run: make test TEST_IPAM=false TEST_EGRESS=true TEST_IPV6=false
if: matrix.ip-version == 'ipv4'
working-directory: v2/e2e
- run: make test TEST_IPAM=false TEST_EGRESS=true TEST_IPV6=true
if: matrix.ip-version == 'ipv6'
working-directory: v2/e2e
- run: make logs
working-directory: v2/e2e
if: always()
- uses: actions/upload-artifact@v4
if: always()
with:
name: logs-egress-${{ matrix.ip-version }}-${{ matrix.kindest-node }}.tar.gz
path: v2/e2e/logs.tar.gz