Skip to content

Commit 140f278

Browse files
authored
Update CI workflow (#275)
1 parent 46086e2 commit 140f278

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

.github/workflows/rust.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Rust CI
22
on:
33
push:
4-
branches: [ master ]
4+
branches: [ main ]
55
pull_request:
6-
branches: [ master ]
6+
branches: [ main ]
77
jobs:
88
build:
99
runs-on: ubuntu-latest
@@ -45,6 +45,31 @@ jobs:
4545
- name: Cargo check
4646
run: cargo check --features "${{ matrix.feature }}" --no-default-features
4747

48+
other_archs:
49+
# github actions does not support 32-bit or big endian systems directly, but
50+
# it does support QEMU. so we install qemu, then build and run the tests on
51+
# emulated systems. NOTE: you can also use this approach to test locally.
52+
runs-on: ubuntu-latest
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
arch: [powerpc-unknown-linux-gnu, i686-unknown-linux-gnu]
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Install or use cached cross-rs/cross
60+
uses: baptiste0928/cargo-install@v2
61+
with:
62+
crate: cross
63+
- name: Cache Cargo Dependencies
64+
uses: Swatinem/rust-cache@v2
65+
with:
66+
cache-on-failure: true
67+
key: ${{ matrix.arch }}
68+
- name: Start Docker (required for cross-rs)
69+
run: sudo systemctl start docker
70+
- name: Cross-Run Tests using QEMU
71+
run: cross test --target ${{ matrix.arch }}
72+
4873
rustfmt:
4974
runs-on: ubuntu-latest
5075
steps:

0 commit comments

Comments
 (0)