Skip to content

Commit 6bbf9a0

Browse files
committed
ci: add MIPS target
1 parent 2acfa27 commit 6bbf9a0

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

.github/target.toml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,22 @@ target = "loongarch64-unknown-linux-gnu"
173173
release-name = "loongarch64-linux"
174174
tool = "cross"
175175
skip-test = true
176-
extra-args = "--no-default-features --features ring"
176+
extra-args = "--no-default-features --features ring"
177+
178+
# ==================== MIPS Targets ====================
179+
180+
# MIPS (big-endian) Linux (MUSL - statically linked)
181+
[[target]]
182+
target = "mips-unknown-linux-musl"
183+
tool = "cross"
184+
extra-args = "--no-default-features --features ring"
185+
build-std = true
186+
skip-test = true
187+
188+
# MIPSEL (little-endian) Linux (MUSL - statically linked)
189+
[[target]]
190+
target = "mipsel-unknown-linux-musl"
191+
tool = "cross"
192+
extra-args = "--no-default-features --features ring"
193+
build-std = true
194+
skip-test = true

.github/workflows/rust-build.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ jobs:
9393
uses: dtolnay/rust-toolchain@master
9494
with:
9595
toolchain: ${{ matrix.toolchain || inputs.rust-toolchain }}
96-
target: ${{ matrix.target }}
97-
components: ${{ matrix.components || 'rustfmt, clippy' }}
96+
targets: ${{ matrix.build-std && 'x86_64-unknown-linux-gnu' || matrix.target }}
97+
components: ${{ matrix.components || matrix.build-std && 'rustfmt,clippy,rust-src' || 'rustfmt, clippy' }}
9898

9999
- name: Cache Docker images for cross
100100
if: matrix.tool == 'cross'
@@ -105,7 +105,9 @@ jobs:
105105
- name: Install cross-compilation tools
106106
if: matrix.tool == 'cross'
107107
run: |
108-
rustup target add ${TARGET}
108+
if [ "${{ matrix.build-std }}" != "true" ]; then
109+
rustup target add ${TARGET}
110+
fi
109111
cargo install cross --git https://github.com/cross-rs/cross --force
110112
env:
111113
TARGET: ${{ matrix.target }}
@@ -134,7 +136,7 @@ jobs:
134136
with:
135137
tool: ${{ matrix.tool }}
136138
command: clippy
137-
args: --all --target ${{ matrix.target }} ${{ matrix.extra-args }} -- -D warnings
139+
args: --all --target ${{ matrix.target }} ${{ matrix.build-std && '-Z build-std=std,panic_abort' || '' }} ${{ matrix.extra-args }} -- -D warnings
138140
env:
139141
RUSTFLAGS: ${{ matrix.rustflags }} ${{ inputs.rustflags }}
140142

@@ -158,7 +160,7 @@ jobs:
158160
with:
159161
tool: ${{ matrix.tool }}
160162
command: build
161-
args: --workspace --release --target ${{ matrix.target }} ${{ matrix.extra-args }}
163+
args: --workspace --release --target ${{ matrix.target }} ${{ matrix.build-std && '-Z build-std=std,panic_abort' || '' }} ${{ matrix.extra-args }}
162164
env:
163165
RUSTFLAGS: ${{ matrix.rustflags }} ${{ inputs.rustflags }}
164166
CROSS_BUILD_ZIG: ${{ matrix.zig }}

0 commit comments

Comments
 (0)