@@ -65,13 +65,13 @@ jobs:
65
65
env :
66
66
PG_VERSION : ${{ matrix.postgres }}
67
67
BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
68
- ENABLE_COVERAGE : ${{ (startsWith(matrix.os, 'ubuntu') && matrix.postgres == 15 ) && '1' || '0' }}
68
+ ENABLE_COVERAGE : ${{ (startsWith(matrix.os, 'ubuntu') && matrix.postgres == 17 ) && '1' || '0' }}
69
69
- name : Run tests linux
70
70
id : test-linux
71
71
run : sudo su postgres -c "PG_VERSION=$PG_VERSION ./ci/scripts/run-tests-linux.sh"
72
72
env :
73
73
PG_VERSION : ${{ matrix.postgres }}
74
- ENABLE_COVERAGE : ${{ (startsWith(matrix.os, 'ubuntu') && matrix.postgres == 15 ) && '1' || '0' }}
74
+ ENABLE_COVERAGE : ${{ (startsWith(matrix.os, 'ubuntu') && matrix.postgres == 17 ) && '1' || '0' }}
75
75
if : ${{ !startsWith(matrix.os, 'mac') }}
76
76
# integration tests
77
77
- name : Set LANTERN_CLI_PATH variable
92
92
- name : Collect coverage files
93
93
id : collect-cov-files
94
94
run : sudo su postgres -c "cd /tmp/lantern/lantern_hnsw/build && make cover"
95
- if : ${{ startsWith(matrix.os, 'ubuntu') && matrix.postgres == 15 }}
95
+ if : ${{ startsWith(matrix.os, 'ubuntu') && matrix.postgres == 17 }}
96
96
97
97
- name : Run update tests linux
98
98
id : update-test-linux
@@ -137,7 +137,7 @@ jobs:
137
137
/tmp/pg-out.log
138
138
/tmp/pg-error.log
139
139
- name : Upload lantern coverage
140
- if : ${{ startsWith(matrix.os, 'ubuntu') && matrix.postgres == 15 }}
140
+ if : ${{ startsWith(matrix.os, 'ubuntu') && matrix.postgres == 17 }}
141
141
uses : actions/upload-artifact@v4
142
142
with :
143
143
name : lantern-lcov.info
@@ -167,8 +167,6 @@ jobs:
167
167
workspaces : |
168
168
lantern_cli
169
169
lantern_extras
170
- - name : Install cargo-llvm-cov
171
- uses : taiki-e/install-action@cargo-llvm-cov
172
170
- name : Setup test env
173
171
run : sudo su -c "PG_VERSION=$PG_VERSION SETUP_ENV=1 SETUP_POSTGRES=1 SETUP_TESTS=1 USE_SOURCE=1 ./ci/scripts/build-extras.sh"
174
172
env :
@@ -178,7 +176,9 @@ jobs:
178
176
cargo install cargo-pgrx --version 0.12.7
179
177
cargo pgrx init "--pg$PG_VERSION" /usr/bin/pg_config
180
178
sed -i -e "s/default = .*/default=[\"pg${PG_VERSION}\"]/" lantern_extras/Cargo.toml
181
- RUSTFLAGS="--cfg profile=\"ci-build\"" cargo pgrx install --sudo --pg-config /usr/bin/pg_config --package lantern_extras
179
+ export RUSTFLAGS='--cfg profile="ci-build" -C instrument-coverage'
180
+ export LLVM_PROFILE_FILE="$(pwd)/coverage-%p-%m.profraw"
181
+ cargo pgrx install --sudo --pg-config /usr/bin/pg_config --package lantern_extras
182
182
env :
183
183
PG_VERSION : ${{ matrix.postgres }}
184
184
- name : Run postgres
@@ -192,14 +192,23 @@ jobs:
192
192
env :
193
193
PG_VERSION : ${{ matrix.postgres }}
194
194
- name : Run tests
195
- run : cargo llvm-cov --workspace --lcov --output-path lantern-extras-lcov.info
195
+ run : |
196
+ export RUSTFLAGS='--cfg profile="ci-build" -C instrument-coverage'
197
+ export LLVM_PROFILE_FILE="$(pwd)/coverage-%p-%m.profraw"
198
+ cargo test
196
199
env :
197
200
OPENAI_TOKEN : ${{ secrets.OPENAI_TOKEN }}
198
201
COHERE_TOKEN : ${{ secrets.COHERE_TOKEN }}
199
202
DB_URL :
" postgres://[email protected] :5432/postgres"
203
+ - name : Collect coverage
204
+ if : ${{ startsWith(matrix.os, 'ubuntu') }}
205
+ run : |
206
+ cargo install grcov
207
+ rustup component add llvm-tools-preview
208
+ grcov *.profraw -s . --binary-path target/debug -t lcov --branch -o lantern-extras-lcov.info --ignore "{target/debug/build/*,lantern_cli/tests/*,lantern_cli/src/main.rs}"
200
209
- name : Upload lantern_extras coverage
201
210
uses : actions/upload-artifact@v4
202
- if : ${{ startsWith(matrix.os, 'ubuntu') && matrix.postgres == 15 }}
211
+ if : ${{ startsWith(matrix.os, 'ubuntu') && matrix.postgres == 17 }}
203
212
with :
204
213
name : lantern-extras-lcov.info
205
214
path : ./lantern-extras-lcov.info
0 commit comments