-
Notifications
You must be signed in to change notification settings - Fork 240
98 lines (86 loc) · 3.2 KB
/
validation-test.yml
File metadata and controls
98 lines (86 loc) · 3.2 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
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
on:
workflow_call:
inputs:
test:
description: The test to run
type: string
required: true
duration:
description: How long to run the test for
type: string
required: false
default: '2h'
# cancel older, redundant runs of same workflow on same branch
concurrency:
group: ${{ github.workflow }}-${{github.event_name}}-${{ github.head_ref || github.ref_name }}-${{ inputs.test }}
cancel-in-progress: true
env:
GOFLAGS: "-trimpath"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-2"
gh_ci_key: ${{ secrets.GH_CI_KEY }}
BUILD_NUMBER: ${{ format('{0}-{1}-{2}', github.run_id, github.run_number, github.run_attempt) }}
TEST_TYPE: ${{ inputs.test }}
TEST_DURATION: ${{ inputs.duration }}
jobs:
validation-test:
name: ${{ inputs.test }} validation
# not applicable to forks. shouldn't run on release build
if: github.repository_owner == 'openziti'
runs-on: ubuntu-24.04
steps:
- name: Git Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install Go
uses: ./.github/actions/setup-go
- name: Install Ziti CI
uses: openziti/ziti-ci@v1
- name: Install Terraform CLI
uses: hashicorp/setup-terraform@v4
with:
terraform_version: ~1.5
- name: Build and Test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ziti_ci_gpg_key: ${{ secrets.ZITI_CI_GPG_KEY }}
ziti_ci_gpg_key_id: ${{ secrets.ZITI_CI_GPG_KEY_ID }}
shell: bash
run: |
$(go env GOPATH)/bin/ziti-ci configure-git
$(go env GOPATH)/bin/ziti-ci generate-build-info common/version/info_generated.go version
pushd zititest && go mod tidy && go install -tags all ./... && popd
go install -tags=all,tests ./...
- name: Create Test Environment
shell: bash
run: |
echo "ZITI_ROOT=$(go env GOPATH)/bin" >> "$GITHUB_ENV"
$(go env GOPATH)/bin/${TEST_TYPE} create -d ${TEST_TYPE}-${GITHUB_RUN_NUMBER} -n ${TEST_TYPE}-${GITHUB_RUN_NUMBER} -l environment=gh-fablab-${TEST_TYPE},ziti_version=$($(go env GOPATH)/bin/ziti-ci -q get-current-version)
$(go env GOPATH)/bin/${TEST_TYPE} up
$(go env GOPATH)/bin/${TEST_TYPE} exec validateUp
- name: Run Validation Loop
shell: bash
timeout-minutes: 380
run: |
echo "ZITI_ROOT=$(go env GOPATH)/bin" >> "$GITHUB_ENV"
$(go env GOPATH)/bin/${TEST_TYPE} exec-loop ${TEST_DURATION} testIteration
- name: Create Logs Archive
if: always()
run: |
$(go env GOPATH)/bin/${TEST_TYPE} get files '*' "./logs/{{ .Id }}/" ./logs
- name: Upload artifacts
uses: actions/upload-artifact@v7
if: always()
with:
name: ${{ env.TEST_TYPE }}-logs-${{ github.run_id }}
path: logs/
compression-level: 7
retention-days: 5
- name: Tear down Test Environment
timeout-minutes: 30
if: always()
shell: bash
run: |
$(go env GOPATH)/bin/${TEST_TYPE} dispose