forked from michaelb/sniprun
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (71 loc) · 2.31 KB
/
rust.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
name: Rust
on:
push:
branches: [ master]
pull_request:
branches: [ master, dev]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
name : build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose --release
buildnightly:
name: build-nightly
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: build
run: cargo build --release
unittest:
name: Unit & integration tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: './ressources/install_all_compilers_ci.sh'
- uses: dlang-community/setup-dlang@v1
- name: Unit tests
run: cargo test --release --features ignore_in_ci
- name: Integration tests
run: cargo test --release --features ignore_in_ci --test integration
install:
name: install (download)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Installation tests
run: ./install.sh
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: './ressources/install_all_compilers_ci.sh'
- uses: dlang-community/setup-dlang@v1
- name: Install Rust
run: rustup component add llvm-tools-preview --toolchain stable-x86_64-unknown-linux-gnu
- name: Install cargo-llvm-cov
run: curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
- name: clean
run: cargo llvm-cov clean --workspace
- name: Generate code coverage for unit test
run: cargo llvm-cov --features ignore_in_ci --workspace --no-report
- name: Generate code coverage for integration tests
run: cargo llvm-cov --lcov --no-report --test integration
- name: Aggregate reports
run: cargo llvm-cov --no-run --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: lcov.info
fail_ci_if_error: false