Repository navigation
117 lines (95 loc) · 2.56 KB
/
Copy pathtest.yml
File metadata and controls
117 lines (95 loc) · 2.56 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
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
name: test
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
jobs:
unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26.7'
cache: true
- name: Install CGO build dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential libc6-dev
- name: gofmt check
run: |
out=$(gofmt -l cmd internal)
if [ -n "$out" ]; then
echo "The following files need gofmt:"
echo "$out"
exit 1
fi
- name: go vet
run: go vet ./...
- name: go test
run: go test ./... -count=1
e2e:
name: End-to-end test
runs-on: ubuntu-latest
needs: unit
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26.7'
cache: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libc6-dev restic
- name: Verify Docker is available
run: docker version
- name: Run end-to-end test
run: ./scripts/test-e2e.sh
- name: Upload reports
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-reports
path: |
.e2e/report.json
.e2e/report.html
if-no-files-found: ignore
failures:
name: Failure-mode tests
runs-on: ubuntu-latest
needs: unit
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26.7'
cache: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libc6-dev restic python3
- name: Run failure-mode tests
run: ./scripts/test-failures.sh
sigterm:
name: SIGTERM cleanup test
runs-on: ubuntu-latest
needs: unit
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26.7'
cache: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libc6-dev restic
- name: Verify Docker is available
run: docker version
- name: Run SIGTERM cleanup test
run: ./scripts/test-sigterm.sh