forked from unicode-org/icu4x
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (60 loc) · 2.47 KB
/
coverage.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
# This file is part of ICU4X. For terms of use, please see the file
# called LICENSE at the top level of the ICU4X source tree
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
name: Coverage
on:
push:
branches: [ main ]
pull_request:
branches: '*'
jobs:
test:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# TODO(#315) Re-include caching that also includes the Rust version in the cache key
## Coverage steps
- name: Get grcov version
id: grcov-version
run: |
echo "::set-output name=hash::$(cargo search grcov | grep '^grcov =' | md5sum)"
shell: bash
- name: Attempt to load cached grcov
uses: actions/cache@v2
id: grcov-cache
with:
path: |
~/.cargo/bin/grcov
~/.cargo/bin/grcov.exe
key: ${{ runner.os }}-make-${{ steps.grcov-version.outputs.hash }}
- name: Install grcov
if: steps.grcov-cache.outputs.cache-hit != 'true'
uses: actions-rs/[email protected]
with:
crate: grcov
version: latest
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-04-05
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
- id: coverage
uses: actions-rs/[email protected]
- name: Push grcov results to Coveralls via GitHub Action
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ steps.coverage.outputs.report }}
- name: Push grcov results to Codecov via GitHub Action
uses: codecov/codecov-action@v1
with:
file: ${{ steps.coverage.outputs.report }}
fail_ci_if_error: true