Skip to content

Commit

Permalink
Merge #926
Browse files Browse the repository at this point in the history
926: fix for real r=Alexhuszagh a=Emilgardis

- make env var uppercase


Co-authored-by: Emil Gardström <[email protected]>
  • Loading branch information
bors[bot] and Emilgardis committed Jul 8, 2022
2 parents 3d6a52a + ac862da commit 66c0633
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ jobs:
run: ./ci/test-cross-image.sh
env:
TARGET: 'aarch64-unknown-linux-gnu'
IMAGE: 'ghcr.io/cross-rs/cross/aarch64-unknown-linux-gnu:main'
IMAGE: 'ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main'
shell: bash

- name: Login to GitHub Container Registry
Expand Down Expand Up @@ -389,7 +389,7 @@ jobs:
- name: Run Docker-in-Docker Test
env:
TARGET: aarch64-unknown-linux-gnu
IMAGE: 'ghcr.io/cross-rs/cross/aarch64-unknown-linux-gnu:main'
IMAGE: 'ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main'
run: ./ci/test-docker-in-docker.sh
shell: bash

Expand Down
7 changes: 5 additions & 2 deletions ci/test-cross-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ set -eo pipefail
if [[ -z "${TARGET}" ]]; then
export TARGET="aarch64-unknown-linux-gnu"
fi
# ^^subst is not supported on macOS bash (bash <4)
# shellcheck disable=SC2155
export TARGET_UPPER=$(echo "$TARGET" | awk '{print toupper($0)}')

if [[ "${IMAGE}" ]]; then
# shellcheck disable=SC2140
export "CROSS_TARGET_${TARGET//-/_}_IMAGE"="${IMAGE}"
export "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE"="${IMAGE}"
fi

if [[ -z "${CROSS_TARGET_CROSS_IMAGE}" ]]; then
Expand All @@ -20,7 +23,7 @@ fi

main() {

docker run --rm -e TARGET -e "CROSS_TARGET_${TARGET//-/_}_IMAGE" \
docker run --rm -e TARGET -e "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE" \
-v /var/run/docker.sock:/var/run/docker.sock \
"${CROSS_TARGET_CROSS_IMAGE}" sh -c '
#!/usr/bin/env sh
Expand Down
7 changes: 5 additions & 2 deletions ci/test-docker-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ set -eo pipefail
if [[ -z "${TARGET}" ]]; then
export TARGET="aarch64-unknown-linux-gnu"
fi
# ^^subst is not supported on macOS bash (bash <4)
# shellcheck disable=SC2155
export TARGET_UPPER=$(echo "$TARGET" | awk '{print toupper($0)}')

if [[ "${IMAGE}" ]]; then
# shellcheck disable=SC2140
export "CROSS_TARGET_${TARGET//-/_}_IMAGE"="${IMAGE}"
export "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE"="${IMAGE}"
fi

source=$(dirname "${BASH_SOURCE[0]}")
Expand All @@ -23,7 +26,7 @@ main() {
docker run -v "${home}":"${home}" -w "${home}" \
--rm -e TARGET -e RUSTFLAGS -e RUST_TEST_THREADS \
-e LLVM_PROFILE_FILE -e CARGO_INCREMENTAL \
-e "CROSS_TARGET_${TARGET//-/_}_IMAGE" \
-e "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE" \
-v /var/run/docker.sock:/var/run/docker.sock \
docker:18.09-dind sh -c '
#!/usr/bin/env sh
Expand Down

0 comments on commit 66c0633

Please sign in to comment.