build: add github ci

This commit is contained in:
spacemeowx2 2020-12-04 17:32:03 +08:00 committed by spacelin
parent 7f42c50a0d
commit b44a2a8a6b

56
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,56 @@
on: [push, pull_request]
name: Build
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release
cross_compile:
name: Cross compile
runs-on: ubuntu-latest
strategy:
matrix:
target:
- armv7-unknown-linux-gnueabihf
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=${{ matrix.target }}