name: ci
on:
pull_request:
branches: ["main"]
env:
CROSS_VERSION: "0.2.5"
GO_VERSION: "1.20.6"
RUST_VERSION: "1.70.0"
jobs:
check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy, rustfmt
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy -- -D warnings
- name: Test
run: cargo test
build:
runs-on: ${{ matrix.os }}
env:
CARGO: cargo
strategy:
matrix:
include:
- target: aarch64-apple-darwin
os: macos-12
no_run: --no-run
- target: x86_64-apple-darwin
os: macos-12
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
target: ${{ matrix.target }}
components: clippy, rustfmt
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Integration tests
run: cargo test ${{ matrix.no_run }} --manifest-path cgo-test/Cargo.toml --target ${{ matrix.target }}
- name: Build
run: cargo build --target ${{ matrix.target }}