-
-
Notifications
You must be signed in to change notification settings - Fork 3
82 lines (78 loc) · 2.5 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Build Project
on:
push:
branches: [master, develop]
tags-ignore:
- "*"
pull_request:
branches: [master, develop]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Install latest stable
id: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.os }}-${{ hashFiles('Cargo.toml') }}
- name: Build projects with all features
run: cargo build --release --all-features --locked
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}
path: |
target/release/aer
target/release/aer-ver
target/release/aer-web
target/release/*.bin
target/release/*.exe
- name: Test projects with all features
run: |
if ($IsWindows) { Set-ExecutionPolicy RemoteSigned -Force }
cargo test --release --all-features --locked
shell: pwsh
coverage:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest] # Coverage report do not work on Windows
features: [all, human, none]
steps:
- uses: actions/checkout@v2
- name: Install latest nightly
id: toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.os }}-${{ hashFiles('Cargo.toml') }}
- name: Run unit tests with coverage report and all features
if: ${{ matrix.features == 'all' }}
uses: Swatinem/fucov@v1
- name: Run unit tests with coverage report and no features
if: ${{ matrix.features == 'none' }}
uses: Swatinem/fucov@v1
with:
args: --workspace --no-default-features
- name: Run unit tests with coverage report and features ${{ matrix.features }}
if: ${{ matrix.features != 'all' && matrix.features != 'none' }}
uses: Swatinem/fucov@v1
with:
args: --workspace --no-default-features --features ${{ matrix.features }}
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
directory: coverage