diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f9730104c..db91a2667 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -137,6 +137,7 @@ jobs: name: Fablab Smoketest # not applicable to forks. shouldn't run on release build if: github.repository_owner == 'openziti' && github.ref != 'refs/heads/main' + needs: [ quickstart ] runs-on: ubuntu-20.04 steps: - name: Git Checkout @@ -232,6 +233,30 @@ jobs: echo "WARN: No instance archive found for simple-transfer-${GITHUB_RUN_NUMBER}.tar.gz.gpg" >&2 fi + quickstart: + name: Run the Go Quickstart + # - always() allows evaluating further conditional expressions even if + # needed jobs were skipped + if: | + always() + runs-on: ubuntu-20.04 + needs: [ linux-build ] + steps: + - name: Git Shallow Checkout + uses: actions/checkout@v3 + + - name: Download linux release artifact + uses: actions/download-artifact@v3 + with: + name: linux-release-${{ github.run_id }} + path: release/ + + - name: Run Go Quickstart Test + timeout-minutes: 5 + run: | + go clean -testcache; + go test -v -tags "quickstart automated" ./ziti/cmd/edge/...; + publish: name: Publish Binaries # - always() allows evaluating further conditional expressions even if diff --git a/quickstart/docker/.env b/quickstart/docker/.env index da4ebbea1..c06edf53b 100644 --- a/quickstart/docker/.env +++ b/quickstart/docker/.env @@ -8,7 +8,7 @@ ZITI_USER=admin ZITI_PWD= ZITI_INTERFACE=0.0.0.0 -# ZITI_GO_VERSION= + # controller name, address/port information ZITI_CTRL_NAME=ziti-controller ZITI_CTRL_EDGE_ADVERTISED_ADDRESS=ziti-edge-controller diff --git a/quickstart/test/compose-test.zsh b/quickstart/test/compose-test.zsh index 5cc2a2d8d..5884541b9 100755 --- a/quickstart/test/compose-test.zsh +++ b/quickstart/test/compose-test.zsh @@ -58,7 +58,6 @@ echo "INFO: Testing Compose project $PWD" declare -a QUICK_FILES=( ../go.{mod,sum} - ./ziti/cmd/edge/quickstart_manual_test.go test/compose.override.yml docker/{simplified-docker-compose.yml,.env} ) @@ -95,7 +94,7 @@ mv ./simplified-docker-compose.yml ./compose.yml # learn the expected Go version from the Go mod file so we can pull the correct container image ZITI_GO_VERSION="$(awk '/^go[[:space:]]+/ {print $2}' ./go.mod)" # make this var available in the Compose project -sed -Ee "s/^(#[[:space:]]+)?(ZITI_GO_VERSION)=.*/\2=${ZITI_GO_VERSION}/" \ +sed -E \ -e "s/^(#[[:space:]]+)?(ZITI_PWD)=.*/\2=${ZITI_PWD}/" \ -e "s/^(#[[:space:]]+)?(ZITI_INTERFACE)=.*/\2=${ZITI_INTERFACE:-127.0.0.1}/" ./.env > ./.env.tmp mv ./.env.tmp ./.env @@ -111,6 +110,12 @@ done # any halt after this point should cause the Compose project to be torn down trap down_project SIGTERM SIGINT EXIT +# these compose vars are used to configure the golang service that runs the test suite +echo -e "ZITI_GO_VERSION=${ZITI_GO_VERSION}"\ + "\nGOPATH=${GOPATH:-${HOME}/go}"\ + "\nZITI_QUICK_DIR=${ZITI_QUICK_DIR}" \ + >> ./.env + # if ZITI_QUICK_IMAGE_TAG is set then run the locally-built image if [[ -n "${ZITI_QUICK_IMAGE_TAG:-}" ]]; then sed -Ee "s/^(#[[:space:]]+)?(ZITI_VERSION)=.*/\2=${ZITI_QUICK_IMAGE_TAG}/" ./.env > ./.env.tmp diff --git a/quickstart/test/compose.override.yml b/quickstart/test/compose.override.yml index 3fc6acf94..bd3846188 100644 --- a/quickstart/test/compose.override.yml +++ b/quickstart/test/compose.override.yml @@ -2,10 +2,13 @@ services: quickstart-test: image: golang:${ZITI_GO_VERSION:-noop}-alpine volumes: - - .:/mnt + # mount the parent dir of the quickstart, which is the top-level of the ziti repo working copy, as /mnt + - ${ZITI_QUICK_DIR:-noop}/..:/mnt + - ${GOPATH:-noop}:/go working_dir: /mnt environment: - ZITI_PWD networks: - ziti - command: go test -v ./quickstart_test.go + command: > + go test -v -tags "quickstart manual" ./ziti/cmd/edge/...