Skip to content

Commit 7aa5fa6

Browse files
authored
Merge branch 'master' into complete-cmd-migration
2 parents 16443ff + c1fc554 commit 7aa5fa6

File tree

4 files changed

+63
-177
lines changed

4 files changed

+63
-177
lines changed

.github/workflows/commit.yaml

Lines changed: 29 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,26 @@ jobs:
4242
name: bin
4343
path: build/bin
4444

45-
e2e_linux:
46-
name: "Run e2e tests on Linux"
45+
e2e:
46+
name: Run e2e tests (${{ matrix.runner.os }}, ${{ matrix.args.extension-language }})
4747
needs:
4848
- bin
49-
runs-on: ubuntu-latest
50-
timeout-minutes: 30 # instead of 360 by default
49+
runs-on: ${{ matrix.runner.os }}
50+
timeout-minutes: 90 # instead of 360 by default
5151
strategy:
5252
matrix:
53-
include: # Controls language used in all extension tests. Managed by test/e2e/main_test.go
53+
runner:
54+
- os: macos-latest
55+
- os: ubuntu-latest
56+
args: # Controls arguments used in all extension tests. Managed by test/e2e/main_test.go
5457
- extension-language: rust
58+
# Attempt to avoid re-downloading almost 200MB of deps per test that implies "getenvoy extension build"
59+
# This uses the RUNNER_TEMP variable directly to avoid having to mkdir a sub-path.
60+
toolchain-container-options: "-v ${RUNNER_TEMP}:/tmp/cargohome -e CARGO_HOME=/tmp/cargohome"
5561
- extension-language: tinygo
62+
toolchain-container-options: ""
5663
env:
57-
E2E_EXTENSION_LANGUAGE: ${{ matrix.extension-language }}
64+
E2E_EXTENSION_LANGUAGE: ${{ matrix.args.extension-language }}
5865
steps:
5966
- name: "Checkout"
6067
uses: actions/checkout@v2
@@ -65,50 +72,26 @@ jobs:
6572
name: bin
6673
path: build/bin
6774

68-
- name: "Build language-specific Docker build images"
69-
run: make builders
70-
71-
- name: "Run e2e tests using the `getenvoy` binary built by the upstream job"
72-
run: | # chmod to restore permissions lost in actions/download-artifact@v2
73-
chmod a+x build/bin/linux/amd64/getenvoy
74-
./ci/e2e/linux/run_tests.sh
75-
76-
e2e_macos:
77-
name: "Run e2e tests on MacOS"
78-
needs:
79-
- bin
80-
runs-on: macos-latest
81-
timeout-minutes: 90 # instead of 360 by default
82-
strategy:
83-
matrix:
84-
include: # Controls language used in all extension tests. Managed by test/e2e/main_test.go
85-
- extension-language: rust
86-
- extension-language: tinygo
87-
env:
88-
E2E_EXTENSION_LANGUAGE: ${{ matrix.extension-language }}
89-
steps:
90-
- name: "Checkout"
91-
uses: actions/checkout@v2
92-
93-
- name: "Re-use the `getenvoy` binary pre-built by the upstream job"
94-
uses: actions/download-artifact@v2
75+
- name: "Install 'Docker for Mac' (Latest)"
76+
uses: docker-practice/actions-setup-docker@v1
77+
if: runner.os == 'macOS' && matrix.args.extension-language == 'tinygo'
9578
with:
96-
name: bin
97-
path: build/bin
79+
docker_buildx: false # Install is flakey. When it, we can install it via docker/setup-buildx-action@v1
80+
timeout-minutes: 20 # fail fast if MacOS install takes too long
9881

99-
- name: "Install 'Docker for Mac' (an older version that can be installed in CI environment)"
100-
run: ./ci/e2e/darwin/install_docker.sh
101-
timeout-minutes: 7 # unfortunately, installing `Docker for Mac` in CI environment is fragile; be ready to restart the job occasionally
82+
- name: "Install 'Docker for Mac' (2.0.0.3 2019-02-15)" # Avoid >1hr tests on macOS+rust. See issue #145
83+
if: runner.os == 'macOS' && matrix.args.extension-language == 'rust'
84+
# don't use `DOCKER_BUILDKIT=1`, `--build-arg BUILDKIT_INLINE_CACHE=1` and `--cache-from`
85+
# options when using this version of `Docker for Mac`
86+
run: |
87+
./ci/e2e/darwin/install_docker.sh
88+
echo "USE_DOCKER_BUILDKIT_CACHE=no" >> $GITHUB_ENV
89+
timeout-minutes: 20 # fail fast if MacOS install takes too long
10290

10391
- name: "Build language-specific Docker build images"
104-
env:
105-
# don't use `DOCKER_BUILDKIT=1`, `--build-arg BUILDKIT_INLINE_CACHE=1` and `--cache-from`
106-
# options when using `Docker for Mac` in CI environment
107-
USE_DOCKER_BUILDKIT_CACHE: 'no'
10892
run: make builders
109-
timeout-minutes: 10 # fail fast if MacOS runner becomes to slow
93+
timeout-minutes: 10 # fail fast if MacOS runner becomes too slow
11094

11195
- name: "Run e2e tests using the `getenvoy` binary built by the upstream job"
112-
run: | # chmod to restore permissions lost in actions/download-artifact@v2
113-
chmod a+x build/bin/darwin/amd64/getenvoy
114-
./ci/e2e/darwin/run_tests.sh
96+
# expand E2E_TOOLCHAIN_CONTAINER_OPTIONS here to allow shell interpolation
97+
run: E2E_TOOLCHAIN_CONTAINER_OPTIONS="${{ matrix.args.toolchain-container-options }}" make e2e

.github/workflows/release.yaml

Lines changed: 34 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,27 @@ jobs:
7171
- name: "Push extension builder images"
7272
run: make builders.push BUILDERS_TAG=${{ env.RELEASE_VERSION }}
7373

74-
e2e_linux:
75-
name: "Run e2e tests on Linux"
74+
e2e:
75+
name: Run e2e tests (${{ matrix.runner.os }}, ${{ matrix.args.extension-language }})
7676
needs:
7777
- getenvoy
7878
- 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
8181
strategy:
8282
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
8487
- 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"
8591
- extension-language: tinygo
92+
toolchain-container-options: ""
8693
env:
87-
E2E_EXTENSION_LANGUAGE: ${{ matrix.extension-language }}
94+
E2E_EXTENSION_LANGUAGE: ${{ matrix.args.extension-language }}
8895
steps:
8996
- name: "Checkout"
9097
uses: actions/checkout@v2
@@ -95,72 +102,33 @@ jobs:
95102
if [[ "${RELEASE_TAG}" = v* ]]; then RELEASE_VERSION="${RELEASE_TAG:1}"; else RELEASE_VERSION="${RELEASE_TAG}"; fi
96103
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
97104
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
104106
105107
- name: "Download `getenvoy` binary from GitHub release assets"
106108
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
108110
INPUT_VERSION: tags/${{ env.RELEASE_TAG }}
109111
run: | # extract getenvoy to location used in `make e2e`. don't chmod because tar.gz should be correct.
110112
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
120116
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'
148120
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
164132

165133
- name: "Pull extension builder images"
166134
# pull Docker images in advance to make output of
@@ -169,4 +137,5 @@ jobs:
169137
timeout-minutes: 10 # fail fast if MacOS runner becomes to slow
170138

171139
- 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

ci/e2e/darwin/run_tests.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

ci/e2e/linux/run_tests.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)