Repository navigation
72 lines (71 loc) · 2.23 KB
/
Copy pathcoverage.yml
File metadata and controls
72 lines (71 loc) · 2.23 KB
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:
branches-ignore:
- "release-plz-*"
workflow_call:
workflow_dispatch:
env:
# increment this manually to force cache eviction
RUST_CACHE_PREFIX: "v0-rust"
jobs:
test:
name: coverage
runs-on: ubuntu-latest
env:
clang: "17"
php_version: "8.4"
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php_version }}
env:
debug: true
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
components: rustfmt, clippy
toolchain: stable
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ env.RUST_CACHE_PREFIX }}
- name: Cache LLVM and Clang
id: cache-llvm
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/llvm-${{ env.clang }}
key: ubuntu-latest-llvm-${{ env.clang }}
- name: Setup LLVM & Clang
id: clang
uses: KyleMayes/install-llvm-action@v2
with:
version: ${{ env.clang }}
directory: ${{ runner.temp }}/llvm-${{ env.clang }}
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
- name: Configure Clang
run: |
echo "LIBCLANG_PATH=${{ runner.temp }}/llvm-${{ env.clang }}/lib" >> $GITHUB_ENV
echo "LLVM_VERSION=${{ steps.clang.outputs.version }}" >> $GITHUB_ENV
echo "LLVM_CONFIG_PATH=${{ runner.temp }}/llvm-${{ env.clang }}/bin/llvm-config" >> $GITHUB_ENV
- name: Install Cargo expand
uses: dtolnay/install@cargo-expand
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run tests
run: |
cargo llvm-cov --workspace \
--features closure,embed,anyhow,observer,smartstring,indexmap \
--tests \
--exclude-from-report tests \
--ignore-filename-regex 'docsrs_bindings\.rs|\.expanded\.rs' \
--lcov --output-path lcov.info
- name: Upload coverage
uses: coverallsapp/github-action@v2
with:
file: lcov.info