-
Notifications
You must be signed in to change notification settings - Fork 93
107 lines (94 loc) · 3.3 KB
/
terratest.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
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
name: Terratest
on:
push:
paths-ignore:
- '**.md'
- '**.svg'
- '**.drawio'
- '.spelling'
pull_request:
branches:
- master
# The specific activity types are listed here to include "labeled" and "unlabeled"
# (which are not included by default for the "pull_request" trigger).
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
paths-ignore:
- '**.md'
- '**.svg'
- '**.drawio'
- '.spelling'
permissions:
contents: read
jobs:
skip-check:
runs-on: ubuntu-latest
name: Skip the job?
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@951b48540b429070694bc8abd82fd6901eb123ca
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- id: skip_check
uses: fkirc/skip-duplicate-actions@84931c63f7562abc89860097e0caf563c7b87f65
with:
skip_after_successful_duplicate: 'true'
do_not_skip: '["workflow_dispatch", "schedule"]'
terratest:
runs-on: ubuntu-22.04
needs: skip-check
if: ${{ needs.skip-check.outputs.should_skip != 'true' }} && !contains( github.event.pull_request.labels.*.name, 'renovate')
steps:
- name: Checkout
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc
with:
fetch-depth: 0
- name: Setup golang
uses: actions/setup-go@bfd2fb341f32be7281829126376a12a780ca79fc
with:
go-version: 1.22.3
- name: Build artifacts
uses: goreleaser/goreleaser-action@006a7a4111c6a1b44a25a1f3d23f0c8d940ad847
with:
version: v1.9.2
args: release --rm-dist --skip-publish --skip-validate --snapshot --skip-sbom --skip-sign
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create edgeDNS k3s Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79
with:
cluster-name: "edgedns"
args: -c k3d/edge-dns.yaml
- name: Create 1st k3s Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79
with:
cluster-name: "test-gslb1"
args: -c k3d/test-gslb1.yaml
- name: Create 2nd k3s Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79
with:
cluster-name: "test-gslb2"
args: -c k3d/test-gslb2.yaml
- name: K8GB deployment
run: |
make deploy-test-version list-running-pods
echo "Cluster 1 (eu):"
kubectl get no -owide --context=k3d-test-gslb1
echo "Cluster 2 (us):"
kubectl get no -owide --context=k3d-test-gslb2
- name: Run Terratest
run: |
mkdir -p ${{ github.workspace }}/tmp/terratest
set -o pipefail
echo "::group::Terratest logs"
make terratest | tee ${{ github.workspace }}/tmp/terratest/all.log
echo "::endgroup::"
- name: Print debug info
if: always()
uses: ./.github/actions/print-debug
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
if: always()
with:
name: terratest-logs
path: ${{ github.workspace }}/tmp/terratest