-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (68 loc) · 2.16 KB
/
Copy pathtests.yml
File metadata and controls
70 lines (68 loc) · 2.16 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
name: 'Tests'
on:
push:
branches-ignore:
- 'gh-pages'
- "dependabot/**"
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ for more details.
# Using pull_request_target in order to grant dependabot access to run the test action.
pull_request_target:
types: [labeled]
workflow_dispatch:
branches-ignore:
- 'gh-pages'
env:
GOMAXPROCS: 2
SPINNAKER_CERT: /dev/shm/spinnaker.crt
SPINNAKER_KEY: /dev/shm/spinnaker.key
jobs:
tests:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
-
name: Cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Print go version
run: go version
# Tests are a bit finicky, so for now just ensure they pass and upload the report.json as an artifact for debugging purpose.
# TODO: Improve tests.
-
name: Run tests(return 0 exit code no mater what for now)
run: |
echo $NONPROD_SPINNAKER_CERT_BASE64 | base64 -d &> $SPINNAKER_CERT
echo $NONPROD_SPINNAKER_KEY_BASE64 | base64 -d &> $SPINNAKER_KEY
chmod 600 $SPINNAKER_CERT $SPINNAKER_KEY
echo "Running tests.. tests take around 16-20 min, see the report.json artifact for output"
./test -json > ./report.json || true
env:
NONPROD_SPINNAKER_CERT_BASE64: ${{ secrets.NONPROD_SPINNAKER_CERT_BASE64 }}
NONPROD_SPINNAKER_KEY_BASE64: ${{ secrets.NONPROD_SPINNAKER_KEY_BASE64 }}
SPINNAKER_ADDRESS: ${{ secrets.NONPROD_SPINNAKER_ADDRESS }}
TF_ACC: 1
-
name: Cleanup keys
if: ${{ always() }}
run: rm $SPINNAKER_CERT $SPINNAKER_KEY
-
name: Upload test output artifact
uses: actions/upload-artifact@v4
with:
path: ./report.json