forked from tezedge/tezedge
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (55 loc) · 1.88 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
name: build
on:
push:
branches: [ master, develop ]
pull_request:
jobs:
test:
name: Test Suite
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.sanitizer == 'address' }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
sanitizer: [none]
include:
- os: ubuntu-latest
sanitizer: address
steps:
- uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2020-12-31
default: true
- name: Settings for cargo in Linux
if: matrix.sanitizer == 'address'
run: |
echo '[build]' >> ~/.cargo/config
echo 'rustflags = ["-Z", "sanitizer=address"]' >> ~/.cargo/config
echo 'rustdocflags = ["-Z", "sanitizer=address"]' >> ~/.cargo/config
echo 'target = "x86_64-unknown-linux-gnu"' >> ~/.cargo/config
- name: Settings for cargo in OSX
if: runner.os == 'macOS'
run: |
echo '[build]' >> ~/.cargo/config
echo 'rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"]' >> ~/.cargo/config
- name: APT dependencies
if: runner.os == 'Linux'
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo add-apt-repository "deb https://apt.llvm.org/trusty/ llvm-toolchain-trusty main"
sudo apt-get update -y
sudo apt-get install libhidapi-dev libsodium-dev libev4 clang libclang-dev llvm-dev g++
- name: OSX dependencies
if: runner.os == 'macOS'
run: brew install hidapi
- name: cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test