This repository has been archived by the owner on Mar 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
164 lines (140 loc) · 4.26 KB
/
testing.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: test-new-ci
permissions:
id-token: write
contents: read
packages: write
defaults:
run:
# We need -e -o pipefail for consistency with GitHub Actions' default behavior
shell: bash -e -o pipefail {0}
on:
push:
workflow_dispatch:
jobs:
create-cluster:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Create k3s cluster in AWS
id: create-cluster
uses: defenseunicorns/uds-aws-ci-k3d@swf_additions
with:
cluster-action: create
aws-assume-role: ${{ secrets.AWS_COMMERCIAL_ROLE_TO_ASSUME_K3D }}
aws-region: us-west-2
instance-size: "c7a.16xlarge"
ami-prefix: "rc-uds-ci-k3d"
k3s: "true"
- name: Upload kubeconfig artifact
uses: actions/upload-artifact@v3
with:
name: kubeconfig
path: ~/.kube/config
- name: Install Pepr lb module
run: |
kubectl apply -f test/lb-annotation-aws/pepr-module-lb-annotate.yaml
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to registry1
uses: docker/login-action@v2
with:
registry: registry1.dso.mil
username: ${{ secrets.REGISTRY1_USERNAME }}
password: ${{ secrets.REGISTRY1_PASSWORD }}
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build bundle and all dependencies
run: |
make build/all
deploy:
runs-on: ubuntu-latest
needs: ["create-cluster", "build"]
steps:
- name: Create k3s cluster in AWS
id: create-cluster
uses: defenseunicorns/uds-aws-ci-k3d@swf_additions
with:
cluster-action: create
aws-assume-role: ${{ secrets.AWS_COMMERCIAL_ROLE_TO_ASSUME_K3D }}
aws-region: us-west-2
instance-size: "c7a.16xlarge"
ami-prefix: "rc-uds-ci-k3d"
k3s: "true"
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download kubeconfig
uses: actions/download-artifact@v3
with:
name: kubeconfig
path: ~/.kube/
- name: Download zarf and uds-cli
run: |
make build/zarf
make build/uds
- name: Move Zarf to /usr/local/bin
run: |
sudo mv build/zarf /usr/local/bin/zarf
sudo chmod +x /usr/local/bin/zarf
- name: Deploy bundle
run: |
make deploy
test:
runs-on: ubuntu-latest
needs: "deploy"
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Create k3s cluster in AWS
id: create-cluster
uses: defenseunicorns/uds-aws-ci-k3d@swf_additions
with:
cluster-action: create
aws-assume-role: ${{ secrets.AWS_COMMERCIAL_ROLE_TO_ASSUME_K3D }}
aws-region: us-west-2
instance-size: "c7a.16xlarge"
ami-prefix: "rc-uds-ci-k3d"
k3s: "true"
- name: Download kubeconfig
uses: actions/download-artifact@v3
with:
name: kubeconfig
path: ~/.kube/
- name: Setup LB hostnames
run: |
utils/metallb/dns.sh
sudo utils/metallb/hosts-write.sh
- name: Run tests
run: |
kubectl rollout status deployment/gitlab-webservice-default -n gitlab --watch --timeout=1200s
curl https://keycloak.bigbang.dev
curl https://gitlab.bigbang.dev
curl https://grafana.bigbang.dev
teardown-cluster:
runs-on: ubuntu-latest
needs: "test"
if: always()
steps:
- name: Teardown k3s cluster
if: always()
# renovate: datasource=github-tags depName=defenseunicorns/uds-aws-ci-k3d versioning=semver
uses: defenseunicorns/uds-aws-ci-k3d@swf_additions
with:
cluster-action: destroy