Skip to content

Commit cb10aae

Browse files
committed
Don't check matrix.target for cross + do related prep
All our jobs have matrix.target set, so that check isn't needed. The intent was to avoid using `cross` when not cross-compiling, but treating an empty value to mean native compilation wouldn't have had any effect. This also does some preparation for related forthcoming changes, moving the job-level `env` below `strategy` (so it remains easy to understand even once it gains matrix-influenced values) and fixing up some wording to reflect that we don't currently build for any bigendian architectures such as s390x.
1 parent cf379f6 commit cb10aae

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,9 @@ jobs:
6464

6565
build-release:
6666
name: build-release
67+
6768
needs: [ create-release ]
68-
env:
69-
# For some builds, we use cross to test on 32-bit and big-endian
70-
# systems.
71-
CARGO: cargo
72-
# Whether CARGO is `cargo` or `cross`, TARGET_FLAGS will be set to `--target matrix.target`.
73-
TARGET_FLAGS: ''
74-
# Whether CARGO is `cargo` or `cross`, TARGET_DIR will include matrix.target.
75-
TARGET_DIR: ./target
76-
# Emit backtraces on panics.
77-
RUST_BACKTRACE: 1
69+
7870
strategy:
7971
matrix:
8072
build: [ linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc ]
@@ -123,6 +115,16 @@ jobs:
123115

124116
runs-on: ${{ matrix.os }}
125117

118+
env:
119+
# For some builds, we use cross to test on 32-bit, and maybe later big-endian, systems.
120+
CARGO: cargo
121+
# Whether CARGO is `cargo` or `cross`, TARGET_FLAGS will be set to `--target matrix.target`.
122+
TARGET_FLAGS: ''
123+
# Whether CARGO is `cargo` or `cross`, TARGET_DIR will include matrix.target.
124+
TARGET_DIR: ./target
125+
# Emit backtraces on panics.
126+
RUST_BACKTRACE: 1
127+
126128
steps:
127129
- name: Checkout repository
128130
uses: actions/checkout@v4
@@ -141,7 +143,7 @@ jobs:
141143
targets: ${{ matrix.target }}
142144

143145
- name: Use Cross
144-
if: matrix.os == 'ubuntu-latest' && matrix.target != ''
146+
if: matrix.os == 'ubuntu-latest'
145147
run: |
146148
cargo install cross
147149
echo 'CARGO=cross' >> "$GITHUB_ENV"

0 commit comments

Comments
 (0)