-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
try cross-platform testing based on cross-platform binary builds
- Loading branch information
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: release | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
jobs: | ||
build-release: | ||
name: test | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
# For some builds, we use cross to test on 32-bit and big-endian | ||
# systems. | ||
CARGO: cargo | ||
# When CARGO is set to CROSS, this is set to `--target matrix.target`. | ||
TARGET_FLAGS: | ||
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target. | ||
TARGET_DIR: ./target | ||
# Emit backtraces on panics. | ||
RUST_BACKTRACE: 1 | ||
strategy: | ||
matrix: | ||
build: [linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc] | ||
include: | ||
- build: linux | ||
os: ubuntu-18.04 | ||
rust: nightly | ||
target: x86_64-unknown-linux-musl | ||
- build: linux-arm | ||
os: ubuntu-18.04 | ||
rust: nightly | ||
target: arm-unknown-linux-gnueabihf | ||
- build: macos | ||
os: macos-latest | ||
rust: nightly | ||
target: x86_64-apple-darwin | ||
- build: win-msvc | ||
os: windows-2019 | ||
rust: nightly | ||
target: x86_64-pc-windows-msvc | ||
- build: win-gnu | ||
os: windows-2019 | ||
rust: nightly-x86_64-gnu | ||
target: x86_64-pc-windows-gnu | ||
- build: win32-msvc | ||
os: windows-2019 | ||
rust: nightly | ||
target: i686-pc-windows-msvc | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
profile: minimal | ||
override: true | ||
target: ${{ matrix.target }} | ||
|
||
- name: Show command used for Cargo | ||
if: success() | ||
run: | | ||
echo "cargo command is: ${{ env.CARGO }}" | ||
echo "target flag is: ${{ env.TARGET_FLAGS }}" | ||
echo "target dir is: ${{ env.TARGET_DIR }}" | ||
- name: Run tests | ||
if: success() | ||
run: ${{ env.CARGO }} test ${{ env.TARGET_FLAGS }} | ||
|