mirror of
https://github.com/openziti/ziti.git
synced 2026-09-10 16:55:41 +00:00
126 lines
3.7 KiB
YAML
126 lines
3.7 KiB
YAML
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-24.04
|
|
steps:
|
|
- name: Shallow checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install zsh
|
|
shell: bash
|
|
run: sudo apt-get update && sudo apt-get install --yes zsh
|
|
|
|
- name: Install Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Build and run a quickstart container image
|
|
shell: bash
|
|
run: ./quickstart/test/compose-test.zsh
|
|
|
|
- name: Upload compose-test logs
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: expressInstall-compose-test-logs
|
|
# compose-test.zsh creates /tmp/compose-test.<datestamp>.<suffix>/logs/
|
|
path: /tmp/compose-test.*/logs/
|
|
retention-days: 2
|
|
if-no-files-found: ignore
|
|
|
|
allInOneTest:
|
|
name: Test all-in-one Quickstart
|
|
runs-on: ubuntu-24.04
|
|
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@v6
|
|
|
|
- name: Install Go
|
|
id: setup-go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- 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-24.04
|
|
env:
|
|
BUILD_DIR: /tmp/build # dir is created by build step and env var used by test script to find ziti executable
|
|
steps:
|
|
- name: Shallow checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Go Caching
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
~/.cache/go-build
|
|
~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Build ziti executable
|
|
shell: bash
|
|
run: |
|
|
mkdir -pv ${BUILD_DIR}
|
|
go build -o ${BUILD_DIR} ${GITHUB_WORKSPACE}/...
|
|
|
|
- name: Build and run a three quickstart in HA mode
|
|
shell: bash
|
|
run: ./quickstart/test/ha-test.sh
|