-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (66 loc) · 1.66 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
name: Test
on:
push:
tags:
- v*.*.*
branches:
- main
- release/v*.*.*
pull_request:
branches:
- main
- release/v*.*.*
permissions:
contents: read
jobs:
Test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.5
- name: Unit Test
run: make test
E2E:
name: E2E
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.5
- name: Setup kustomize
uses: imranismail/setup-kustomize@v2
with:
kustomize-version: 4.1.3
- name: Start minikube
uses: medyagh/setup-minikube@master
with:
kubernetes-version: v1.22.3
- name: Run Tests
run: make e2e
- name: Collect logs
if: ${{ failure() }} #Only collect logs if e2e tests fail since it will not collect logs in makefile
run: |
mkdir -p e2e/logs
kubectl logs -n vault-plugin-argocd-tokens-testing -l app.kubernetes.io/name=argocd-server > ./e2e/logs/argocd-server.log
kubectl logs -n vault-plugin-argocd-tokens-testing vault > ./e2e/logs/vault.log
- name: Archive logs
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: e2e logs
path: |
e2e/logs
- name: Destroy
if: ${{ always() }}
run: |
make destroy
minikube stop
minikube delete