Skip to content

Commit d62e50d

Browse files
committed
try cross-platform testing based on cross-platform binary builds
1 parent ead2494 commit d62e50d

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: release
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
branches: [ master ]
7+
jobs:
8+
build-release:
9+
name: test
10+
runs-on: ${{ matrix.os }}
11+
env:
12+
# For some builds, we use cross to test on 32-bit and big-endian
13+
# systems.
14+
CARGO: cargo
15+
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
16+
TARGET_FLAGS:
17+
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
18+
TARGET_DIR: ./target
19+
# Emit backtraces on panics.
20+
RUST_BACKTRACE: 1
21+
strategy:
22+
matrix:
23+
build: [linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc]
24+
include:
25+
- build: linux
26+
os: ubuntu-18.04
27+
rust: nightly
28+
target: x86_64-unknown-linux-musl
29+
- build: linux-arm
30+
os: ubuntu-18.04
31+
rust: nightly
32+
target: arm-unknown-linux-gnueabihf
33+
- build: macos
34+
os: macos-latest
35+
rust: nightly
36+
target: x86_64-apple-darwin
37+
- build: win-msvc
38+
os: windows-2019
39+
rust: nightly
40+
target: x86_64-pc-windows-msvc
41+
- build: win-gnu
42+
os: windows-2019
43+
rust: nightly-x86_64-gnu
44+
target: x86_64-pc-windows-gnu
45+
- build: win32-msvc
46+
os: windows-2019
47+
rust: nightly
48+
target: i686-pc-windows-msvc
49+
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v1
53+
with:
54+
fetch-depth: 1
55+
56+
- name: Install Rust
57+
uses: actions-rs/toolchain@v1
58+
with:
59+
toolchain: ${{ matrix.rust }}
60+
profile: minimal
61+
override: true
62+
target: ${{ matrix.target }}
63+
64+
- name: Show command used for Cargo
65+
if: success()
66+
run: |
67+
echo "cargo command is: ${{ env.CARGO }}"
68+
echo "target flag is: ${{ env.TARGET_FLAGS }}"
69+
echo "target dir is: ${{ env.TARGET_DIR }}"
70+
71+
- name: Run tests
72+
if: success()
73+
run: ${{ env.CARGO }} test ${{ env.TARGET_FLAGS }}
74+

0 commit comments

Comments
 (0)