forked from canonical/chisel
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 1.39 KB
/
tests.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
name: Tests
on:
workflow_dispatch:
push:
paths-ignore:
- '**.md'
pull_request:
branches: [main]
jobs:
unit-tests:
runs-on: ubuntu-22.04
name: Unit Tests
env:
TEST_COVERAGE_FILE: test-coverage.out
TEST_COVERAGE_HTML_FILE: test-coverage.html
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Run unit tests
run: go test -v -cover -coverprofile=${TEST_COVERAGE_FILE} ./...
- name: Convert test coverage to HTML
if: always()
continue-on-error: true
run: |
set -eu
if [ -f ${TEST_COVERAGE_FILE} ]
then
go tool cover -html=${TEST_COVERAGE_FILE} \
-o=${TEST_COVERAGE_HTML_FILE}
fi
- name: Upload HTML test coverage
uses: actions/upload-artifact@v3
if: always()
continue-on-error: true
with:
name: chisel-test-coverage.html
path: ./*.html
real-archive-tests:
# Do not change to newer releases as "fips" may not be available there.
runs-on: ubuntu-20.04
name: Real Archive Tests
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Run real archive tests
run: |
go test ./internal/archive/ --real-archive