-
Notifications
You must be signed in to change notification settings - Fork 7
63 lines (62 loc) · 1.65 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
name: Build
on:
- push
- pull_request
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.48
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: "${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}"
- run: cargo test
build:
name: Build Binary
needs:
- test
runs-on: "${{ matrix.os }}"
strategy:
matrix:
include:
- os: macos-latest
target: x86_64-apple-darwin
suffix: ''
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
suffix: ''
- os: windows-latest
target: x86_64-pc-windows-msvc
suffix: '.exe'
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: '${{ matrix.target }}'
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: |
cargo test --target "${{ matrix.target }}" --release
cargo build --target "${{ matrix.target }}" --release
- run: |
cargo install cargo-strip
cargo strip --target "${{ matrix.target }}"
- uses: actions/upload-artifact@v2
with:
name: 'at51-${{ matrix.os }}'
path: 'target/${{ matrix.target }}/release/at51${{ matrix.suffix }}'