mirror of
https://github.com/chmln/sd
synced 2024-11-22 19:23:08 +00:00
71cb0d834a
This target requires cross-compilation on the default (x86_64) `macos-latest` platform. However, `cross` does [not yet](https://github.com/rust-embedded/cross/issues/508) provide the right target. If tests can be skipped a build solution outside of `cross` is already discussed [here](https://github.com/BurntSushi/ripgrep/issues/1737).
61 lines
1.4 KiB
YAML
61 lines
1.4 KiB
YAML
name: Test
|
|
|
|
on: [pull_request]
|
|
|
|
jobs:
|
|
test:
|
|
name: ${{ matrix.target }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
use-cross: false
|
|
|
|
- os: ubuntu-latest
|
|
target: x86_64-unknown-linux-musl
|
|
use-cross: false
|
|
|
|
- os: ubuntu-latest
|
|
target: arm-unknown-linux-gnueabihf
|
|
use-cross: true
|
|
|
|
- os: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
use-cross: false
|
|
|
|
- os: macos-latest
|
|
target: x86_64-apple-darwin
|
|
use-cross: false
|
|
|
|
steps:
|
|
- 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 }}
|
|
|
|
- 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
|
|
|
|
- name: Test
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
use-cross: ${{ matrix.use-cross }}
|
|
command: test
|
|
args: --target ${{ matrix.target }}
|