forked from qdrant/qdrant
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (105 loc) · 3.99 KB
/
Copy pathcoverage.yml
File metadata and controls
111 lines (105 loc) · 3.99 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Coverage Report - dev
on:
workflow_dispatch: # Trigger from UI for selected branch
schedule:
- cron: "0 0 * * *" # Every day at midnight UTC
env:
POETRY_VERSION: 2.1.3
jobs:
unit-coverage:
runs-on: ubuntu-latest
steps:
- name: Install minimal stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: actions/checkout@v5
with:
# If scheduled by cron, run for dev branch, Otherwise specified branch (for workflow dispatch & push)
ref: ${{ github.event_name == 'schedule' && 'dev' || github.ref_name }}
fetch-depth: 0
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Install llvm-cov
run: cargo install cargo-llvm-cov && sudo apt install -y lcov
- name: Run unit tests with coverage
run: RUN_PER_PACKAGE=true tools/unit-test-coverage.sh
- name: Upload unit test coverage artifact
uses: actions/upload-artifact@v4
with:
name: unit-test-coverage
path: unit-test-coverage.lcov
retention-days: 1
integration-coverage:
runs-on: ubuntu-latest
steps:
- name: Install minimal stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: actions/checkout@v5
with:
# If scheduled by cron, run for dev branch, Otherwise specified branch (for workflow dispatch & push)
ref: ${{ github.event_name == 'schedule' && 'dev' || github.ref_name }}
fetch-depth: 0
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Install llvm-cov
run: cargo install cargo-llvm-cov && sudo apt install -y lcov
- name: Install dependencies
run: sudo apt-get install clang
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install dependencies
run: |
echo "Installing Poetry $POETRY_VERSION"
curl -sSL https://install.python-poetry.org | python3 - --version "$POETRY_VERSION"
poetry --project tests check --lock
poetry --project tests install --no-root
- name: Run integration tests with coverage
run: tools/integration-test-coverage.sh
- name: Upload integration test coverage artifact
uses: actions/upload-artifact@v4
with:
name: integration-test-coverage
path: integration-test-coverage.lcov
retention-days: 1
merge-and-upload:
needs: [unit-coverage, integration-coverage]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
# If scheduled by cron, run for dev branch, Otherwise specified branch (for workflow dispatch & push)
ref: ${{ github.event_name == 'schedule' && 'dev' || github.ref_name }}
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Install lcov
run: sudo apt install -y lcov
- name: Download unit test coverage
uses: actions/download-artifact@v5
with:
name: unit-test-coverage
- name: Download integration test coverage
uses: actions/download-artifact@v5
with:
name: integration-test-coverage
- name: Merge coverage reports
run: lcov -a unit-test-coverage.lcov -a integration-test-coverage.lcov -o merged.lcov
- name: Upload coverage data to Codecov
uses: codecov/codecov-action@v5
with:
files: merged.lcov
override_branch: ${{ github.event_name == 'schedule' && 'dev' || github.ref_name }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true