Skip to content

Commit 08660b9

Browse files
authored
Try #764: --target powerpc-unknown-linux-gnu --target x86_64-unknown-linux-gnu.2.17
2 parents 42cea7d + 84d6f6f commit 08660b9

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ jobs:
8585
- name: Generate matrix
8686
id: generate-matrix
8787
run: |
88+
set -x
8889
if [[ -z "${commit_message}" ]]; then
8990
bors_args=()
9091
else
@@ -102,15 +103,15 @@ jobs:
102103
103104
selects=()
104105
for target in "${targets[@]}"; do
105-
selects+=(".target == \"${target}\"")
106+
selects+=(".target + (if .sub then \".\" + .sub else \"\" end) == \"${target}\"")
106107
done
107108
query=$(printf " or %s" "${selects[@]}")
108109
query="${query:4}"
109110
110111
if [[ "${#targets[@]}" != "0" ]]; then
111112
echo "Only running targets matching '${targets[@]}'."
112113
matrix=$(
113-
yq --output-format json '[.[] | select('"${query}"')]' <<< "${matrix}"
114+
yq --output-format json <<< "${matrix}" | jq '[.[] | select('"${query}"')]'
114115
)
115116
else
116117
echo 'Running all targets.'
@@ -130,7 +131,7 @@ jobs:
130131
}}
131132
matrix: |
132133
- { target: x86_64-apple-darwin, os: macos-10.15, cpp: 1, dylib: 1, std: 1, run: 1, deploy: true }
133-
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: native qemu-user qemu-system, deploy: true }
134+
- { target: x86_64-unknown-linux-gnu, sub: "2.17", os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: native qemu-user qemu-system, deploy: true }
134135
- { target: x86_64-unknown-linux-musl, os: ubuntu-latest, std: 1, run: 1, deploy: true }
135136
- { target: x86_64-pc-windows-msvc, os: windows-2019, cpp: 1, std: 1, run: 1, deploy: true }
136137
@@ -209,9 +210,10 @@ jobs:
209210
id: build-docker-image
210211
if: runner.os == 'Linux'
211212
timeout-minutes: 60
212-
run: ./build-docker-image.sh "${TARGET}"
213+
run: ./build-docker-image.sh "${TARGET}${SUB+.$SUB}"
213214
env:
214215
TARGET: ${{ matrix.target }}
216+
SUB: ${{ matrix.sub || "" }}
215217
shell: bash
216218
- name: Set Docker image for test
217219
if: steps.build-docker-image.outputs.image

build-docker-image.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ pushd docker
2020
run() {
2121
local push="${1}"
2222
local build_args=()
23-
23+
echo "${1} - ${2}"
2424
if "${push}"; then
2525
build_args+=(--push)
2626
else
2727
build_args+=(--load)
2828
fi
2929

3030
local dockerfile="Dockerfile.${2}"
31-
local image_name="ghcr.io/cross-rs/${2}"
31+
local name=${2%%.*}
32+
local suffix=${2#*.}
33+
local image_name="ghcr.io/cross-rs/${name}"
3234

3335
local tags=()
3436

@@ -45,14 +47,14 @@ run() {
4547

4648
# Tag stable versions as latest.
4749
if ! [[ "${tag_version}" =~ -.* ]]; then
48-
tags+=("${image_name}:latest")
50+
tags+=("${image_name}:latest${suffix:+-${suffix}}")
4951
fi
5052
;;
5153
branch:*)
5254
# Tag active branch as edge.
53-
tags+=("${image_name}:${GITHUB_REF_NAME}")
55+
tags+=("${image_name}:${GITHUB_REF_NAME}${suffix:+-${suffix}}")
5456
if ! [[ "${GITHUB_REF_NAME-}" =~ staging ]] && ! [[ "${GITHUB_REF_NAME-}" =~ trying ]]; then
55-
tags+=("${image_name}:edge")
57+
tags+=("${image_name}:edge${suffix:+-${suffix}}")
5658
fi
5759
;;
5860
*)
@@ -62,13 +64,13 @@ run() {
6264
fi
6365

6466
# Local development.
65-
tags+=("${image_name}:local")
67+
tags+=("${image_name}:local${suffix:+-${suffix}}")
6668
;;
6769
esac
6870

6971
build_args+=(
7072
--pull
71-
--cache-from "type=registry,ref=${image_name}:main"
73+
--cache-from "type=registry,ref=${image_name}:main${suffix:+-${suffix}}"
7274
)
7375

7476
if "${push}"; then

0 commit comments

Comments
 (0)