Skip to content

Merge pull request #42 from bchainhub/github-actions #40

Merge pull request #42 from bchainhub/github-actions

Merge pull request #42 from bchainhub/github-actions #40

on: push
name: foxar pipeline
jobs:
tests:
name: build ${{ matrix.job.target }} (${{ matrix.job.os }})
runs-on: ${{ matrix.job.os }}
strategy:
matrix:
job:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.job.target }}
- name: Git
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"
- name: Apple M1 setup
if: ${{ matrix.job.target == 'aarch64-apple-darwin' }}
run: |
echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV
- name: Linux ARM setup
if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }}
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
# For some reason the FFI cheatcode uses WSL bash instead of Git bash, so we need to install a WSL distribution
- name: Windows setup
if: ${{ matrix.job.target == 'x86_64-pc-windows-msvc' }}
uses: Vampire/setup-wsl@v1
with:
distribution: Ubuntu-20.04
set-as-default: true
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Test
run: cargo test --all --all-features
- name: Build
run: cargo build