forked from tezedge/tezedge
-
Notifications
You must be signed in to change notification settings - Fork 7
68 lines (66 loc) · 2.55 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
63
64
65
66
67
68
name: build
on:
push:
branches: [ master ]
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@v3
- name: Setup Rust (regular)
if: matrix.sanitizer != 'address'
uses: dtolnay/[email protected]
with:
target: wasm32-unknown-unknown
- name: Setup Rust (for sanitizer)
if: matrix.sanitizer == 'address'
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-06-21
- name: Settings for cargo in Linux
if: matrix.sanitizer == 'address'
run: |
echo '[build]' >> ~/.cargo/config.toml
echo 'rustflags = ["-Z", "sanitizer=address"]' >> ~/.cargo/config.toml
echo 'rustdocflags = ["-Z", "sanitizer=address"]' >> ~/.cargo/config.toml
echo 'target = "x86_64-unknown-linux-gnu"' >> ~/.cargo/config.toml
- name: Settings for cargo in OSX
if: runner.os == 'macOS'
run: |
echo '[build]' >> ~/.cargo/config.toml
echo 'rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"]' >> ~/.cargo/config.toml
- 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 libev4 clang libclang-dev llvm-dev g++
- name: OSX dependencies
if: runner.os == 'macOS'
run: brew install pkg-config gmp libev hidapi libffi llvm
- name: cargo check (default features)
run: cargo check
- name: cargo check (no default features)
run: cargo check --no-default-features
- name: cargo test
run: cargo test
- name: cargo build - wasm32 (OSX)
if: runner.os == 'macOS'
run: |
export PATH=/usr/local/opt/llvm/bin:$PATH
cargo check --target wasm32-unknown-unknown --no-default-features
- name: cargo build - wasm32 (Linux)
if: runner.os == 'linux' && matrix.sanitizer != 'address'
run: cargo build --target wasm32-unknown-unknown --no-default-features