From 1f83c0243b025da2928a83666e7b9286dacdb3c8 Mon Sep 17 00:00:00 2001 From: Iryna Shustava Date: Tue, 25 Oct 2022 14:58:08 -0600 Subject: [PATCH] use docker images to download consul binary for unit tests --- .github/workflows/test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4bc3052983..010cd9e04a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,9 +4,10 @@ on: env: TEST_RESULTS: /tmp/test-results # path to where test results are saved - CONSUL_VERSION: 1.14.0-beta1 # Consul's OSS version to use in tests - CONSUL_ENT_VERSION: 1.14.0-beta1+ent # Consul's enterprise version to use in tests GOTESTSUM_VERSION: 1.8.2 # You cannot use environment variables with workflows. The gotestsum version is hardcoded in the reusable workflows too. + # We use docker images to copy the consul binary for unit tests. + CONSUL_OSS_DOCKER_IMAGE: hashicorppreview/consul:1.14.0-dev # Consul's OSS version to use in tests + CONSUL_ENT_DOCKER_IMAGE: hashicorppreview/consul-enterprise:1.14.0-dev # Consul's enterprise version to use in tests jobs: get-go-version: @@ -158,7 +159,7 @@ jobs: working-directory: control-plane run: | mkdir -p $HOME/bin - container_id=$(docker create hashicorppreview/consul:1.14-dev) + container_id=$(docker create ${{env.CONSUL_OSS_DOCKER_IMAGE}}) docker cp "$container_id:/bin/consul" $HOME/bin/consul docker rm "$container_id" - name: Run go tests @@ -205,7 +206,7 @@ jobs: working-directory: control-plane run: | mkdir -p $HOME/bin - container_id=$(docker create hashicorppreview/consul-enterprise:1.14-dev) + container_id=$(docker create ${{env.CONSUL_ENT_DOCKER_IMAGE}}) docker cp "$container_id:/bin/consul" $HOME/bin/consul docker rm "$container_id"