Skip to content

Merge pull request #24 from feliperbroering/release-please--branches-… #62

Merge pull request #24 from feliperbroering/release-please--branches-…

Merge pull request #24 from feliperbroering/release-please--branches-… #62

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt -- --check
- run: cargo clippy -- -D warnings
- run: cargo test
- run: cargo build --release
check-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test
- run: cargo build --release
build:
needs: check
strategy:
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
use_cross: true
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
use_cross: true
- target: x86_64-apple-darwin
os: macos-latest
use_cross: false
- target: aarch64-apple-darwin
os: macos-latest
use_cross: false
- target: x86_64-pc-windows-msvc
os: windows-latest
use_cross: false
- target: aarch64-pc-windows-msvc
os: windows-latest
use_cross: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Install cross
if: matrix.use_cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Build (cross)
if: matrix.use_cross
run: cross build --release --target ${{ matrix.target }}
- name: Build (cargo)
if: "!matrix.use_cross"
run: cargo build --release --target ${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: eai-${{ matrix.target }}
path: target/${{ matrix.target }}/release/eai${{ contains(matrix.target, 'windows') && '.exe' || '' }}