@@ -71,20 +71,27 @@ jobs:
71
71
- name : " Push extension builder images"
72
72
run : make builders.push BUILDERS_TAG=${{ env.RELEASE_VERSION }}
73
73
74
- e2e_linux :
75
- name : " Run e2e tests on Linux "
74
+ e2e :
75
+ name : Run e2e tests (${{ matrix.runner.os }}, ${{ matrix.args.extension-language }})
76
76
needs :
77
77
- getenvoy
78
78
- builders
79
- runs-on : ubuntu-latest
80
- timeout-minutes : 30 # instead of 360 by default
79
+ runs-on : ${{ matrix.runner.os }}
80
+ timeout-minutes : 90 # instead of 360 by default
81
81
strategy :
82
82
matrix :
83
- include : # Controls language used in all extension tests. Managed by test/e2e/main_test.go
83
+ runner :
84
+ - os : macos-latest
85
+ - os : ubuntu-latest
86
+ args : # Controls arguments used in all extension tests. Managed by test/e2e/main_test.go
84
87
- extension-language : rust
88
+ # Attempt to avoid re-downloading almost 200MB of deps per test that implies "getenvoy extension build"
89
+ # This uses the RUNNER_TEMP variable directly to avoid having to mkdir a sub-path.
90
+ toolchain-container-options : " -v ${RUNNER_TEMP}:/tmp/cargohome -e CARGO_HOME=/tmp/cargohome"
85
91
- extension-language : tinygo
92
+ toolchain-container-options : " "
86
93
env :
87
- E2E_EXTENSION_LANGUAGE : ${{ matrix.extension-language }}
94
+ E2E_EXTENSION_LANGUAGE : ${{ matrix.args. extension-language }}
88
95
steps :
89
96
- name : " Checkout"
90
97
uses : actions/checkout@v2
@@ -95,72 +102,33 @@ jobs:
95
102
if [[ "${RELEASE_TAG}" = v* ]]; then RELEASE_VERSION="${RELEASE_TAG:1}"; else RELEASE_VERSION="${RELEASE_TAG}"; fi
96
103
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
97
104
echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV
98
-
99
- - name : " Download `e2e` binary pre-built by the upstream job"
100
- uses : actions/download-artifact@v2
101
- with :
102
- name : bin
103
- path : build/bin
105
+ echo "OS_NAME=$(uname -s)" >> $GITHUB_ENV
104
106
105
107
- name : " Download `getenvoy` binary from GitHub release assets"
106
108
env :
107
- INPUT_FILE : getenvoy_${{ env.RELEASE_VERSION }}_Linux_x86_64 .tar.gz
109
+ INPUT_FILE : getenvoy_${{ env.RELEASE_VERSION }}_${{ env.OS_NAME }}_x86_64 .tar.gz
108
110
INPUT_VERSION : tags/${{ env.RELEASE_TAG }}
109
111
run : | # extract getenvoy to location used in `make e2e`. don't chmod because tar.gz should be correct.
110
112
curl -s https://raw.githubusercontent.com/dsaltares/fetch-gh-release-asset/0.0.5/fetch_github_asset.sh | bash
111
- mkdir -p build/bin/linux/amd64
112
- tar -C build/bin/linux/amd64 -xf ${INPUT_FILE} getenvoy
113
-
114
- - name : " Pull extension builder images"
115
- # pull Docker images in advance to make output of `getenvoy extension build | test | run` stable
116
- run : make builders.pull BUILDERS_TAG=${{ env.RELEASE_VERSION }}
117
-
118
- - name : " Run e2e tests using released `getenvoy` binary and published extension builder images"
119
- run : ./ci/e2e/linux/run_tests.sh
113
+ GOOS=$(uname -s|tr '[:upper:]' '[:lower:]')
114
+ mkdir -p build/bin/${GOOS}/amd64
115
+ tar -C build/bin/${GOOS}/amd64 -xf ${INPUT_FILE} getenvoy
120
116
121
- e2e_macos :
122
- name : " Run e2e tests on MacOS"
123
- needs :
124
- - getenvoy
125
- - builders
126
- runs-on : macos-latest
127
- timeout-minutes : 90 # instead of 360 by default
128
- strategy :
129
- matrix :
130
- include : # Controls language used in all extension tests. Managed by test/e2e/main_test.go
131
- - extension-language : rust
132
- - extension-language : tinygo
133
- env :
134
- E2E_EXTENSION_LANGUAGE : ${{ matrix.extension-language }}
135
- steps :
136
- - name : " Checkout"
137
- uses : actions/checkout@v2
138
-
139
- - name : " Get tag name"
140
- run : | # Trim "v" prefix in the release tag
141
- RELEASE_TAG=${GITHUB_REF#refs/*/}
142
- if [[ "${RELEASE_TAG}" = v* ]]; then RELEASE_VERSION="${RELEASE_TAG:1}"; else RELEASE_VERSION="${RELEASE_TAG}"; fi
143
- echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
144
- echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV
145
-
146
- - name : " Download `e2e` binary pre-built by the upstream job"
147
- uses : actions/download-artifact@v2
117
+ - name : " Install 'Docker for Mac' (Latest)"
118
+ uses : docker-practice/actions-setup-docker@v1
119
+ if : runner.os == 'macOS' && matrix.args.extension-language == 'tinygo'
148
120
with :
149
- name : bin
150
- path : build/bin
151
-
152
- - name : " Download `getenvoy` binary from GitHub release assets"
153
- env :
154
- INPUT_FILE : getenvoy_${{ env.RELEASE_VERSION }}_Darwin_x86_64.tar.gz
155
- INPUT_VERSION : tags/${{ env.RELEASE_TAG }}
156
- run : | # extract getenvoy to location used in `make e2e`. don't chmod because tar.gz should be correct.
157
- curl -s https://raw.githubusercontent.com/dsaltares/fetch-gh-release-asset/0.0.5/fetch_github_asset.sh | bash
158
- mkdir -p build/bin/darwin/amd64
159
- tar -C build/bin/darwin/amd64 -xf ${INPUT_FILE} getenvoy
160
-
161
- - name : " Install 'Docker for Mac' (an older version that can be installed in CI environment)"
162
- run : ./ci/e2e/darwin/install_docker.sh
163
- timeout-minutes : 7 # unfortunately, installing `Docker for Mac` in CI environment is fragile; be ready to restart the job ocasionally
121
+ docker_buildx : false # Install is flakey. When it, we can install it via docker/setup-buildx-action@v1
122
+ timeout-minutes : 20 # fail fast if MacOS install takes too long
123
+
124
+ - name : " Install 'Docker for Mac' (2.0.0.3 2019-02-15)" # Avoid >1hr tests on macOS+rust. See issue #145
125
+ if : runner.os == 'macOS' && matrix.args.extension-language == 'rust'
126
+ # don't use `DOCKER_BUILDKIT=1`, `--build-arg BUILDKIT_INLINE_CACHE=1` and `--cache-from`
127
+ # options when using this version of `Docker for Mac`
128
+ run : |
129
+ ./ci/e2e/darwin/install_docker.sh
130
+ echo "USE_DOCKER_BUILDKIT_CACHE=no" >> $GITHUB_ENV
131
+ timeout-minutes : 20 # fail fast if MacOS install takes too long
164
132
165
133
- name : " Pull extension builder images"
166
134
# pull Docker images in advance to make output of
@@ -169,4 +137,5 @@ jobs:
169
137
timeout-minutes : 10 # fail fast if MacOS runner becomes to slow
170
138
171
139
- name : " Run e2e tests using released `getenvoy` binary and published extension builder images"
172
- run : ./ci/e2e/darwin/run_tests.sh
140
+ # expand E2E_TOOLCHAIN_CONTAINER_OPTIONS here to allow shell interpolation
141
+ run : E2E_TOOLCHAIN_CONTAINER_OPTIONS="${{ matrix.args.toolchain-container-options }}" make e2e
0 commit comments