-
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (51 loc) · 1.37 KB
/
go.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
name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
services:
vault:
image: hashicorp/vault:1.15
env:
VAULT_DEV_ROOT_TOKEN_ID: token
VAULT_DEV_LISTEN_ADDRESS: 0.0.0.0:8200
VAULT_TOKEN: token
VAULT_ADDR: http://127.0.0.1:8200
options: >-
--cap-add=IPC_LOCK
--health-cmd "vault status"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 8200:8200
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Display Go version
run: go version
- name: Build
run: go build -v ./cmd/vht
- name: Test
run: |
export VAULT_ADDR="http://$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -q)):8200"
go test -cover -coverprofile=coverage.out -v ./...
env:
VAULT_TOKEN: token
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage.out
flags: unittests