-
Notifications
You must be signed in to change notification settings - Fork 9
130 lines (126 loc) · 3.68 KB
/
tests.yml
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
118
119
120
121
122
123
124
125
126
127
128
129
130
name: tests
on:
pull_request:
branches:
- main
- release-*
jobs:
unit:
runs-on: ubuntu-latest
env:
CK8S_AUTO_APPROVE: true
strategy:
fail-fast: false
matrix:
tag:
- general
- aws
- azure
- baremetal
- elastx
- openstack
- safespring
- upcloud
steps:
- name: checkout compliantkubernetes-apps
uses: actions/checkout@v4
- name: setup docker with buildx
uses: docker/setup-buildx-action@v3
- name: build tests unit container image
uses: docker/build-push-action@v6
with:
cache-from: type=gha
context: .
target: unit
file: ./tests/Dockerfile
load: true
pull: false
push: false
provenance: false
tags: compliantkubernetes-apps-tests:unit
- name: run static unit tests
working-directory: ./tests
run: make run-unit/${{ matrix.tag }}
regression:
runs-on: ubuntu-latest
needs: [ unit ]
if: github.ref_name == 'main' || contains(github.event.pull_request.labels.*.name, 'test/regression')
env:
CK8S_AUTO_APPROVE: true
strategy:
fail-fast: false
matrix:
tag:
- general
steps:
- name: checkout compliantkubernetes-apps
uses: actions/checkout@v4
- name: setup docker with buildx
uses: docker/setup-buildx-action@v3
- name: build tests main container image
uses: docker/build-push-action@v6
with:
cache-from: type=gha
context: .
target: main
file: ./tests/Dockerfile
load: true
pull: false
push: false
provenance: false
tags: compliantkubernetes-apps-tests:main
- name: create local cache
run: ./scripts/local-cluster.sh cache create
- name: create local resolve
run: ./scripts/local-cluster.sh resolve create test.dev-ck8s.com
- name: run regression tests
working-directory: ./tests
run: make run-regression/${{ matrix.tag }}
- name: delete local resolve
if: always()
run: ./scripts/local-cluster.sh resolve delete
- name: delete local cache
if: always()
run: ./scripts/local-cluster.sh cache delete
integration:
runs-on: ubuntu-latest
needs: [ unit ]
if: github.ref_name == 'main' || contains(github.event.pull_request.labels.*.name, 'test/integration')
env:
CK8S_AUTO_APPROVE: true
strategy:
fail-fast: false
matrix:
tag:
- general
- harbor
steps:
- name: checkout compliantkubernetes-apps
uses: actions/checkout@v4
- name: setup docker with buildx
uses: docker/setup-buildx-action@v3
- name: build tests main container image
uses: docker/build-push-action@v6
with:
cache-from: type=gha
context: .
target: main
file: ./tests/Dockerfile
load: true
pull: false
push: false
provenance: false
tags: compliantkubernetes-apps-tests:main
- name: create local cache
run: ./scripts/local-cluster.sh cache create
- name: create local resolve
run: ./scripts/local-cluster.sh resolve create test.dev-ck8s.com
- name: run integration tests
working-directory: ./tests
run: make run-integration/${{ matrix.tag }}
- name: delete local resolve
if: always()
run: ./scripts/local-cluster.sh resolve delete
- name: delete local cache
if: always()
run: ./scripts/local-cluster.sh cache delete