ci: add support for loongarch64-unknown-linux-gnu #203
Workflow file for this run
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
name: Build & Test | |
on: [push, pull_request] | |
jobs: | |
rustfmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
components: rustfmt | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
windows-msvc: | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [i686-pc-windows-msvc, x86_64-pc-windows-msvc] | |
target: [i686-pc-windows-msvc, x86_64-pc-windows-msvc, aarch64-pc-windows-msvc] | |
channel: [1.70.0, stable, beta, nightly] | |
runs-on: windows-latest | |
name: Windows - ${{ matrix.target }} - ${{ matrix.channel }} | |
env: | |
RUST_BACKTRACE: 1 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.channel }}-${{ matrix.toolchain }} | |
target: ${{ matrix.target }} | |
override: true | |
profile: minimal | |
default: true | |
- name: Test libffi-sys-rs | |
run: | | |
cd libffi-sys-rs | |
cargo test | |
- name: Test libffi-rs | |
run: | | |
cd libffi-rs | |
cargo test | |
windows-gnu: | |
strategy: | |
fail-fast: false | |
matrix: | |
channel: [1.70.0, stable, beta, nightly] | |
runs-on: windows-latest | |
name: Windows - x86_64-pc-windows-gnu - ${{ matrix.channel }} | |
env: | |
RUST_BACKTRACE: 1 | |
steps: | |
- name: Setup MSYS2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
release: false | |
path-type: inherit | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.channel }}-x86_64-pc-windows-gnu | |
target: x86_64-pc-windows-gnu | |
override: true | |
profile: minimal | |
default: true | |
- name: Test libffi-sys-rs | |
shell: msys2 {0} | |
run: | | |
cd libffi-sys-rs | |
cargo test | |
- name: Test libffi-rs | |
shell: msys2 {0} | |
run: | | |
cd libffi-rs | |
cargo test | |
macos: | |
strategy: | |
fail-fast: false | |
matrix: | |
# rust < 1.54 does not work on macos >= 12: | |
# https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20How.20can.20I.20fix.20Rust.201.2E53.2E0.20or.20earlier.20to.20run.20on.20macOS.2012.2E6.3F/near/299263887 | |
# channel: [1.70.0, stable, beta, nightly] | |
channel: [stable, beta, nightly] | |
features: ["--no-default-features", "--features system"] | |
runs-on: macos-latest | |
name: macOS - ${{ matrix.channel }} ${{ matrix.features }} | |
env: | |
RUST_BACKTRACE: 1 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: brew install autoconf automake libtool libffi | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.channel }}-x86_64-apple-darwin | |
target: x86_64-apple-darwin | |
override: true | |
profile: minimal | |
default: true | |
- name: Test libffi-sys-rs | |
run: | | |
cd libffi-sys-rs | |
cargo test ${{ matrix.features }} | |
- name: Test libffi-rs | |
run: | | |
cd libffi-rs | |
cargo test ${{ matrix.features }} | |
linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
channel: [1.70.0, stable, beta, nightly] | |
features: ["--no-default-features", "--features system"] | |
target: | |
- x86_64-unknown-linux-gnu | |
- i686-unknown-linux-gnu | |
- aarch64-unknown-linux-gnu | |
- armv7-unknown-linux-gnueabihf | |
- riscv64gc-unknown-linux-gnu | |
- s390x-unknown-linux-gnu | |
- loongarch64-unknown-linux-gnu | |
exclude: | |
# Don't try to build with `--features system` when cross-compiling | |
# It's probably possible to make this work for some of these architectures | |
# (e.g. I got it working on my Ubuntu image for i686), but it complicates | |
# testing a bit | |
- target: i686-unknown-linux-gnu | |
features: "--features system" | |
- target: aarch64-unknown-linux-gnu | |
features: "--features system" | |
- target: armv7-unknown-linux-gnueabihf | |
features: "--features system" | |
- target: riscv64gc-unknown-linux-gnu | |
features: "--features system" | |
- target: s390x-unknown-linux-gnu | |
features: "--features system" | |
- target: loongarch64-unknown-linux-gnu | |
features: "--features system" | |
# 1.70.0 is too old for loongarch64-unknown-linux-gnu | |
- target: loongarch64-unknown-linux-gnu | |
channel: 1.70.0 | |
runs-on: ubuntu-latest | |
name: Linux - ${{ matrix.channel }} ${{ matrix.features }} ${{ matrix.target }} | |
env: | |
RUST_BACKTRACE: 1 | |
TEST_RUNNER: cargo | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.channel }} | |
target: ${{ matrix.target }} | |
override: true | |
profile: minimal | |
default: true | |
- name: Set-up Cross Compiling | |
id: arch_attrs | |
if: ${{ 'x86_64-unknown-linux-gnu' != matrix.target }} | |
run: | | |
cargo install cross --git https://github.com/cross-rs/cross --rev 7a2b4e408a5b61a61cf08d88e484d57be7af6cd4 --locked | |
echo "TEST_RUNNER=cross" >> $GITHUB_ENV | |
- name: Test libffi-sys-rs | |
run: | | |
cd libffi-sys-rs | |
${{ env.TEST_RUNNER }} test --target ${{ matrix.target }} ${{ matrix.features }} | |
- name: Test libffi-rs | |
run: | | |
cd libffi-rs | |
${{ env.TEST_RUNNER }} test --target ${{ matrix.target }} ${{ matrix.features }} |