forked from vmware-archive/database-stream-processor
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (60 loc) · 2.15 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
name: Coverage
on: [push, pull_request]
env:
# It's really `--all-features`, but not adding `persistence`, we expect the
# persistence feature to go away again in the future (but if we add it
# unconditionally it changes the code that's run significantly)
ALMOST_ALL_FEATURES: --features "with-serde with-csv"
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
paths_ignore: '["**/README.md", "**/doc/**"]'
do_not_skip: '["workflow_dispatch", "schedule"]'
check:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
name: Coverage
runs-on: [self-hosted, Linux, skylake-2x]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: llvm-tools-preview
- name: Restore cache
uses: Swatinem/rust-cache@v1
- name: Install redpanda
if: runner.os == 'Linux'
run: |
curl -1sLf 'https://dl.redpanda.com/nzc4ZYQK3WRGd9sy/redpanda/cfg/setup/bash.deb.sh' | sudo -E bash && \
sudo apt install redpanda -y && \
sudo systemctl start redpanda
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
uses: actions-rs/cargo@v1
with:
command: llvm-cov
args: ${{ env.ALMOST_ALL_FEATURES }} --workspace --lcov --output-path coverage.info --ignore-filename-regex tests.rs
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.info
fail_ci_if_error: true
- name: Archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: coverage.info