Skip to content

Commit b532671

Browse files
committed
add QEMU CI support
1 parent 2815421 commit b532671

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

.github/workflows/checks.yaml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
with:
8585
shared-key: "${{matrix.rust}}-${{matrix.target}}"
8686
- name: cargo build
87-
run: cargo build ${{ matrix.features }}
87+
run: cargo build --target ${{matrix.target}} ${{ matrix.features }}
8888
- name: cargo nextest # reports segfaults in a helpful way
8989
run: cargo nextest run --target ${{matrix.target}} ${{ matrix.features }} --no-fail-fast
9090
env:
@@ -101,6 +101,51 @@ jobs:
101101
files: lcov.info
102102
fail_ci_if_error: false
103103

104+
build-qemu:
105+
name: QEMU build & test
106+
runs-on: "${{ matrix.os }}"
107+
strategy:
108+
matrix:
109+
include:
110+
- rust: stable
111+
os: ubuntu-latest
112+
features: ""
113+
target: "s390x-unknown-linux-gnu"
114+
steps:
115+
- name: Checkout sources
116+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
117+
with:
118+
persist-credentials: false
119+
- name: Install Dependencies
120+
run: |
121+
sudo apt-get update
122+
sudo apt-get install -y qemu qemu-system-s390x gcc-s390x-linux-gnu
123+
- name: Copy QEMU Cargo Config
124+
run: |
125+
mkdir -p .cargo
126+
cp qemu-cargo-config.toml .cargo/config.toml
127+
- name: Install toolchain
128+
uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248
129+
with:
130+
toolchain: "stable"
131+
targets: "${{ matrix.target }}"
132+
- name: target
133+
run: "rustc -vV | sed -n 's|host: ||p'"
134+
- name: Install cargo-nextest
135+
uses: taiki-e/install-action@56ab7930c591507f833cbaed864d201386d518a8
136+
with:
137+
tool: cargo-nextest
138+
- name: Rust cache
139+
uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8
140+
with:
141+
shared-key: "${{matrix.rust}}-${{matrix.target}}"
142+
- name: cargo build
143+
run: cargo build --target ${{matrix.target}} ${{ matrix.features }}
144+
- name: cargo nextest # reports segfaults in a helpful way
145+
run: cargo nextest run --target ${{matrix.target}} ${{ matrix.features }} --no-fail-fast
146+
env:
147+
RUST_BACKTRACE: 1
148+
104149
clippy:
105150
name: Clippy
106151
strategy:

qemu-cargo-config.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# gets copied to .cargo/config.toml on CI, meant to run tests under qemu
2+
3+
[target.s390x-unknown-linux-gnu]
4+
runner = "qemu-s390x -L /usr/s390x-linux-gnu"
5+
linker = "s390x-linux-gnu-gcc"

0 commit comments

Comments
 (0)