-
Notifications
You must be signed in to change notification settings - Fork 5
126 lines (126 loc) · 4.19 KB
/
tests.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
117
118
119
120
121
122
123
124
125
126
name: Tests
on:
pull_request:
push:
branches:
- main
concurrency:
group: ci-tests-${{ github.head_ref || github.ref }}-${{ github.repository }}
cancel-in-progress: true
jobs:
unit-tests:
runs-on: kvm
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Run tests
run: |
sudo go run github.com/onsi/ginkgo/v2/ginkgo -v -r -p --covermode=atomic --coverprofile=coverage.out --timeout=2h --skipPackage ./e2e ./...
- name: Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./coverage.out
e2e-tests:
runs-on: kvm
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Build local image
uses: docker/build-push-action@v6
with:
push: false
load: true
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64
tags: auroraboot:latest
- name: Run e2e tests
run: |
sudo go run github.com/onsi/ginkgo/v2/ginkgo -v -r -p --covermode=atomic --coverprofile=coverage.out --timeout=2h --label-filter "!bootable && !raw-bootable" ./e2e
- name: Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./coverage.out
test-bootable:
runs-on: ubuntu-latest
steps:
- uses: earthly/actions-setup@v1.0.13
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: earthly +test-bootable
test-bootable-raw:
runs-on: kvm
steps:
- uses: earthly/actions-setup@v1.0.13
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install deps
run: |
sudo apt-get update && sudo apt-get install -y ovmf libvirt-clients libvirt-daemon-system libvirt-daemon virtinst bridge-utils qemu-system-x86 qemu-system-x86 qemu-utils qemu-kvm acl udev
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Build local image
uses: docker/build-push-action@v6
with:
push: false
load: true
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64
tags: auroraboot:latest
- name: Generate raw image
run: |
docker run --rm --privileged -v $PWD/build/:/output auroraboot:latest --debug --set "disable_http_server=true" --set "disable_netboot=true" --set "disk.raw=true" --set "disk.size=16000" --set "container_image=quay.io/kairos/ubuntu:24.04-core-amd64-generic-v3.2.3" --set "state_dir=/output"
- name: Test raw image is bootable
env:
FIRMWARE: /usr/share/OVMF/OVMF_CODE.fd
USE_QEMU: true
MEMORY: 4000
CPUS: 2
CREATE_VM: true
KVM: true
run: |
# TODO: permissions stuff should be fixed on aurora side, the output dir should contain only
# there required output image/iso and not the leftovers from the build process
sudo chmod -R 777 build
#earthly +test-bootable-raw
export RAW_IMAGE=$(find $PWD/build -name *.raw)
go run github.com/onsi/ginkgo/v2/ginkgo run --label-filter "raw-bootable" -v --fail-fast -r ./e2e