-
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (62 loc) · 1.92 KB
/
coveralls.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: coveralls
on: push
jobs:
test:
name: Coveralls Upload
runs-on: ubuntu-latest
# setup
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.26
- name: Install dependencies
run: bun install
# Bun tests
- name: Run JavaScript/TypeScript tests
run: bun run test
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# setup rust
- name: Install Clippy
run: rustup component add clippy
- name: Install llvm-tools-preview
run: rustup component add llvm-tools-preview
- name: Install grcov
run: |
sudo apt-get install lcov
cargo install grcov
- name: Build Rust project
run: cargo build
shell: bash
# Rust tests
- name: Run Rust tests with coverage
run: |
export CARGO_INCREMENTAL=0
export RUSTFLAGS='-Cinstrument-coverage'
export LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw'
cargo test
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*/.cargo/*" --ignore "/*/target/*" -o ./coverage/rust-lcov.info
shell: bash
# Merge LCOV reports
- name: Merge Bun and Rust LCOV reports
run: |
mkdir -p coverage
if [ -f ./coverage/lcov.info ] && [ -f ./coverage/rust-lcov.info ]; then
cat ./coverage/rust-lcov.info >> ./coverage/lcov.info
elif [ -f ./coverage/rust-lcov.info ]; then
mv ./coverage/rust-lcov.info ./coverage/lcov.info
fi
# upload to Coveralls
- name: Upload coverage to Coveralls
run: |
if [ -f ./coverage/lcov.info ]; then
bun run coveralls < ./coverage/lcov.info
fi
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}