-
Notifications
You must be signed in to change notification settings - Fork 60
50 lines (41 loc) · 1.33 KB
/
build-and-test.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
name: Build and Tests
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
test-scenario: [short, long]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: install-go
run: sudo snap install go --classic
- name: build
run: go build ./...
- name: apt-update
run: sudo apt update
- name: install-test-dependencies
run: sudo apt install -y snapd germinate mtools debootstrap eatmydata fdisk gdisk qemu-system-aarch64 qemu-user-static ubuntu-dev-tools
- name: short tests
if: ${{ matrix.test-scenario == 'short' }}
run: sudo go test -timeout 0 -v -test.short -coverprofile=.coverage/coverage-short.out -covermode=atomic ./...
- name: long tests
if: ${{ matrix.test-scenario == 'long' }}
run: sudo go test -timeout 0 -v -coverprofile=.coverage/coverage-long.out -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: unittests
files: .coverage/coverage-*.out
verbose: true