-
Notifications
You must be signed in to change notification settings - Fork 9
117 lines (96 loc) · 2.73 KB
/
test.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
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:
- 'main'
pull_request:
branches:
- '*'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
- run: go install golang.org/x/tools/cmd/[email protected]
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: go test ./...
- name: Format
run: go fmt ./...
- name: Vet
run: go vet ./...
- run: goimports -w .
- name: Verify No Changes
id: verify-no-changes
uses: tj-actions/[email protected]
- name: Fail If Changes
if: steps.verify-no-changes.outputs.files_changed == 'true'
run: "false"
integration-test:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install
run: go install .
- name: Export Command Test
run: it/export.sh
docs:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
- uses: actions/checkout@v4
- name: Documentation Build
run: go run ./hack/generate-manual
- uses: actions/upload-artifact@v3
with:
name: man-pages
path: man/
# This action tests two things: That the GitHub Action works (as defined in the action.yml file) and by running
# Paranoia on itself that we are shipping only the correct certs internally.
paranoia-action-self-check:
runs-on: ubuntu-latest
env:
CONTAINER_TAR: container.tar
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and export to Docker
uses: docker/build-push-action@v4
with:
context: .
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=docker,dest=${{ env.CONTAINER_TAR }}
- name: Paranoia Self-Check
uses: ./
with:
target_tar: file://${{ env.CONTAINER_TAR }}