-
Notifications
You must be signed in to change notification settings - Fork 71
101 lines (85 loc) · 3.34 KB
/
ci.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Build and test
on: [push, pull_request]
# Make sure CI fails on all warnings, including Clippy lints
env:
RUSTFLAGS: "-Dwarnings"
jobs:
build:
strategy:
matrix:
include:
# Linux dummy crypto
- OS: ubuntu-latest
TARGET: x86_64-unknown-linux-gnu
NATIVE_BUILD: true
ADD_INSTALL: |
sudo apt-get update
sudo apt-get install -y libudev-dev
BUILD_OPTIONS: --features crypto_dummy --no-default-features
# Linux NSS crypto
- OS: ubuntu-latest
TARGET: x86_64-unknown-linux-gnu
NATIVE_BUILD: true
ADD_INSTALL: |
sudo apt-get update
sudo apt-get install -y libudev-dev mercurial node-gyp ninja-build
BUILD_OPTIONS: --features crypto_nss --no-default-features
# Linux openSSL crypto
- OS: ubuntu-latest
TARGET: x86_64-unknown-linux-gnu
NATIVE_BUILD: true
ADD_INSTALL: |
sudo apt-get update
sudo apt-get install -y libudev-dev openssl
BUILD_OPTIONS: --features crypto_openssl --no-default-features
# Mac dummy crypto
- OS: macos-latest
TARGET: x86_64-apple-darwin
NATIVE_BUILD: true
BUILD_OPTIONS: --features crypto_dummy --no-default-features --target=x86_64-apple-darwin
# Windows dummy crypto
- OS: windows-latest
TARGET: x86_64-pc-windows-gnu
NATIVE_BUILD: true
BUILD_OPTIONS: --features crypto_dummy --no-default-features --target=x86_64-pc-windows-gnu
# FreeBSD - cross compile
- OS: ubuntu-latest
TARGET: x86_64-unknown-freebsd
NATIVE_BUILD: false
ADD_INSTALL: |
sudo apt-get update
sudo apt-get install -y libudev-dev
BUILD_OPTIONS: --features crypto_dummy --no-default-features
# netBSD - cross compile
- OS: ubuntu-latest
TARGET: x86_64-unknown-netbsd
NATIVE_BUILD: false
ADD_INSTALL: |
sudo apt-get update
sudo apt-get install -y libudev-dev
BUILD_OPTIONS: --features crypto_dummy --no-default-features
# Android - cross compile
- OS: ubuntu-latest
TARGET: x86_64-linux-android
NATIVE_BUILD: false
ADD_INSTALL: |
sudo apt-get update
sudo apt-get install -y libudev-dev
BUILD_OPTIONS: --features crypto_dummy --no-default-features
runs-on: ${{ matrix.OS }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install latest rust toolchain
run: rustup target add ${{ matrix.TARGET }}
- name: Install Packages
if: ${{ matrix.ADD_INSTALL }}
run: ${{ matrix.ADD_INSTALL }}
- name: Build
run: cargo build --target ${{ matrix.TARGET }} --all --release ${{ matrix.BUILD_OPTIONS }}
- name: Test
# Run tests only if it is a native build
if: ${{ matrix.NATIVE_BUILD }}
run: cargo test --target ${{ matrix.TARGET }} ${{ matrix.BUILD_OPTIONS }} -- --show-output
- name: Clippy
run: cargo clippy --all --target ${{ matrix.TARGET }} ${{ matrix.BUILD_OPTIONS }}