forked from lf-edge/eve
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (78 loc) · 2.43 KB
/
go-tests.yml
File metadata and controls
79 lines (78 loc) · 2.43 KB
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
# Copyright (c) 2025, Zededa, Inc.
# SPDX-License-Identifier: Apache-2.0
---
name: Go Tests
on: # yamllint disable-line rule:truthy
push:
branches:
- "master"
- "[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+-stable"
- "feature/*"
paths-ignore:
- '**/*.md'
- '.github/**'
pull_request:
branches:
- "master"
- "[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+-stable"
- "feature/*"
paths-ignore:
- '**/*.md'
- '.github/**'
jobs:
test:
runs-on: zededa-ubuntu-2204
env:
REPO_NAME: ${{ github.event.repository.full_name }}
GH_REF: ${{ github.ref }}
steps:
- name: Starting Report
run: |
echo Git Ref: ${GH_REF}
echo GitHub Event: ${{ github.event_name }}
echo Disk usage
df -h
echo Memory
free -m
- name: Clear repository
run: |
sudo rm -fr "$GITHUB_WORKSPACE" && mkdir "$GITHUB_WORKSPACE"
rm -fr ~/.linuxkit
docker system prune --all --force --volumes
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Login to Docker Hub
if: ${{ github.event.repository.full_name == 'lf-edge/eve' }}
run: | # Runners must provide default credentials
docker login
- name: Test
run: |
make test
- name: Test (TPM Required)
run: |
bash tests/tpm/prep-and-test.sh
- name: Report test results as Annotations
if: ${{ always() }}
uses: guyarb/golang-test-annoations@2941118d7ef622b1b3771d1ff6eae9e90659eb26 # v0.8.0
with:
test-results: dist/amd64/results.json
- name: Store raw test results
if: ${{ always() }}
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: 'test-report'
path: ${{ github.workspace }}/dist
- name: Get code coverage
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
- name: Clean
if: ${{ always() }}
run: |
make clean || :
docker system prune -f -a || :
docker rm -f $(docker ps -aq) && docker volume rm -f $(docker volume ls -q) || :
rm -rf ~/.linuxkit || :