-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (71 loc) · 2.29 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: CI-Tests
on:
workflow_dispatch:
push:
branches: ['main', 'release-*']
pull_request:
permissions: read-all
env:
GO_VERSION: 1.23.1
jobs:
unit-tests:
name: Run unit tests
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v3
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
- name: Create config.ini
uses: DamianReeves/[email protected]
with:
path: ${{ github.workspace }}/test/config.ini
contents: |
tpp_url=${{ secrets.TPP_URL }}
access_token=${{ secrets.ACCESS_TOKEN }}
tpp_project=${{ secrets.TPP_PROJECT }}
- name: Create config-ecdsa.ini
uses: DamianReeves/[email protected]
with:
path: ${{ github.workspace }}/test/config-ecdsa.ini
contents: |
tpp_url=${{ secrets.TPP_URL }}
access_token=${{ secrets.ACCESS_TOKEN }}
tpp_project=${{ secrets.TPP_ECDSA_PROJECT }}
- name: Run Go tests
run: go test -covermode atomic -coverprofile ./coverage.txt $(go list ./... | grep -v third_party/)
env:
TPP_URL: ${{ secrets.TPP_URL }}
TPP_USERNAME: ${{ secrets.TPP_USERNAME }}
TPP_PASSWORD: ${{ secrets.TPP_PASSWORD }}
- name: Upload Coverage Report
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
env_vars: OS
files: ./coverage.txt
verbose: true
- name: Run Go tests w/ `-race`
if: ${{ runner.os == 'Linux' }}
run: go test -race $(go list ./... | grep -v third_party/)
env:
TPP_URL: ${{ secrets.TPP_URL }}
TPP_USERNAME: ${{ secrets.TPP_USERNAME }}
TPP_PASSWORD: ${{ secrets.TPP_PASSWORD }}