2020-07-03 15:38:52 +00:00
|
|
|
name: Test
|
|
|
|
|
|
|
|
on: [pull_request]
|
|
|
|
|
|
|
|
jobs:
|
2020-07-03 15:51:57 +00:00
|
|
|
test:
|
2020-07-03 15:55:22 +00:00
|
|
|
name: ${{ matrix.target }}
|
2020-07-03 15:38:52 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
target: x86_64-unknown-linux-gnu
|
2021-03-01 04:41:21 +00:00
|
|
|
use-cross: false
|
2020-07-03 15:38:52 +00:00
|
|
|
|
|
|
|
- os: ubuntu-latest
|
|
|
|
target: x86_64-unknown-linux-musl
|
2021-03-01 04:41:21 +00:00
|
|
|
use-cross: false
|
|
|
|
|
|
|
|
- os: ubuntu-latest
|
|
|
|
target: arm-unknown-linux-gnueabihf
|
|
|
|
use-cross: true
|
2020-07-03 15:38:52 +00:00
|
|
|
|
|
|
|
- os: windows-latest
|
|
|
|
target: x86_64-pc-windows-msvc
|
2021-03-01 04:41:21 +00:00
|
|
|
use-cross: false
|
2020-07-03 15:38:52 +00:00
|
|
|
|
|
|
|
- os: macos-latest
|
|
|
|
target: x86_64-apple-darwin
|
2021-03-01 04:41:21 +00:00
|
|
|
use-cross: false
|
2020-07-03 15:38:52 +00:00
|
|
|
|
|
|
|
steps:
|
2020-07-03 15:40:54 +00:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
|
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
target: ${{ matrix.target }}
|
2020-07-03 15:38:52 +00:00
|
|
|
|
2021-03-19 15:12:55 +00:00
|
|
|
- name: Create .cargo/config.toml
|
|
|
|
if: ${{ matrix.use-cross == true }}
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir .cargo
|
|
|
|
cat > .cargo/config.toml <<EOF
|
|
|
|
[target.${{ matrix.target }}]
|
|
|
|
rustflags = ["--cfg", "sd_cross_compile"]
|
|
|
|
EOF
|
|
|
|
|
2021-03-01 04:46:49 +00:00
|
|
|
- name: Test
|
2021-03-01 04:41:21 +00:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
use-cross: ${{ matrix.use-cross }}
|
|
|
|
command: test
|
|
|
|
args: --target ${{ matrix.target }}
|