Skip to content

add gh action

add gh action #1

Workflow file for this run

name: Rust Multi-Arch Build
on:
push:
branches:
- master
pull_request:
jobs:
test:
name: Test for ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
- target: armv7-unknown-linux-gnueabihf
- target: aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Install cross
run: cargo install cross
- name: Test binary
run: cross test --target ${{ matrix.target }}
build:
name: Build for ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
- target: armv7-unknown-linux-gnueabihf
- target: aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Install cross
run: cargo install cross
- name: Build binary
run: cross build --target ${{ matrix.target }} --release
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: target/${{ matrix.target }}/release/