-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (84 loc) · 2.68 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
name: E2E Tests
on:
pull_request:
permissions:
contents: read
jobs:
build-e2e-images:
name: Build E2E Images
runs-on: ubuntu-22.04
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Install requirements
run: |
sudo apt install make
sudo snap install go --classic
- name: Build provider images
run: sudo make docker-build-e2e
- name: Cleanup space
# Github runners are tight on space and will fail if we don't clean up before.
run: sudo docker builder prune -f
- name: Build images
run: |
cd templates/docker
sudo docker build . -t k8s-snap:dev
- name: Cleanup space
# Github runners are tight on space and will fail if we don't clean up before.
run: sudo docker builder prune -f
- name: Save provider image
run: |
sudo docker save -o provider-images.tar ghcr.io/canonical/cluster-api-k8s/controlplane-controller:dev ghcr.io/canonical/cluster-api-k8s/bootstrap-controller:dev
sudo chmod 775 provider-images.tar
- name: Save k8s-snap image
run: |
sudo docker save -o k8s-snap-image.tar k8s-snap:dev
sudo chmod 775 k8s-snap-image.tar
ls -la
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: e2e-images
path: |
provider-images.tar
k8s-snap-image.tar
run-e2e-tests:
name: Run E2E Tests
runs-on: ubuntu-22.04
needs: build-e2e-images
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 512
swap-size-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: Check out repo
uses: actions/checkout@v4
- name: Install requirements
run: |
sudo apt install make
sudo snap install go --classic
sudo docker network create kind --driver=bridge -o com.docker.network.bridge.enable_ip_masquerade=true
df -h
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: e2e-images
path: .
- name: Space check
run: |
ls
df -h
rm -rf provider-images.tar k8s-snap-image.tar
df -h
- name: Load provider image
run: sudo docker load -i provider-images.tar
- name: Load k8s-snap image
run: sudo docker load -i k8s-snap-image.tar
- name: Run e2e tests
run: sudo make test-e2e