-
Notifications
You must be signed in to change notification settings - Fork 166
108 lines (93 loc) · 3.07 KB
/
test-quickstart.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
name: Test Quickstart
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
# cancel older, redundant runs of same workflow on same branch
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
expressInstallTest:
name: Test expressInstall() Quickstart
runs-on: ubuntu-latest
steps:
- name: Shallow checkout
uses: actions/checkout@v4
- name: Install zsh
shell: bash
run: sudo apt-get update && sudo apt-get install --yes zsh
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- name: Build and run a quickstart container image
shell: bash
run: ./quickstart/test/compose-test.zsh
allInOneTest:
name: Test all-in-one Quickstart
runs-on: ubuntu-latest
env:
ZITI_CLI_TAG: local # override default :latest since we're not pulling from registry
ARTIFACTS_DIR: ./build # output dir for `go build`, input dir for `compose up --build`
DOCKER_BUILD_DIR: ./dist/docker-images/ziti-cli
ZIGGY_UID: 1001 # let container EUID run-as GHA "runner" user to share cache, etc.
steps:
- name: Shallow checkout
uses: actions/checkout@v4
- name: Install Go
id: setup-go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- name: Build ziti executable
shell: bash
run: |
mkdir -pv ${ARTIFACTS_DIR}/amd64/linux
go build -o ${ARTIFACTS_DIR}/amd64/linux ${GITHUB_WORKSPACE}/...
- name: Run the all-in-one quickstart with locally-built ziti executable
shell: bash
working-directory: ./quickstart/docker/all-in-one
run: |
docker compose up --build --detach
- name: Wait for all-in-one quickstart controller then run quickstart tests
shell: bash
working-directory: ./quickstart/docker/all-in-one
env:
ZITI_GO_VERSION: ${{ steps.setup-go.outputs.go-version }}
run: |
sleep 9 # wait a moment for the :local image to build
docker compose --profile test run --rm quickstart-test
- name: Print debug info
if: always()
shell: bash
working-directory: ./quickstart/docker/all-in-one
run: |
set +e
set -x
id runner
ls -lAn ${GOCACHE:-${HOME}/.cache/go-build}/ ${GOPATH:-${HOME}/go}/pkg/mod/
docker compose --profile test logs
exit 0
haQuickstartTest:
name: Test HA Quickstart
runs-on: ubuntu-latest
steps:
- name: Shallow checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- name: Build ziti executable
shell: bash
run: |
mkdir -pv /tmp/build
go build -o /tmp/build ${GITHUB_WORKSPACE}/...
- name: Build and run a three quickstart in HA mode
shell: bash
run: ./quickstart/test/ha-test.sh