-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Coverage | ||
|
||
on: [push] | ||
|
||
jobs: | ||
linux: | ||
name: Update Code Coverage | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install rust nightly toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
profile: minimal | ||
override: true | ||
|
||
- name: Install grcov | ||
run: cargo install grcov | ||
|
||
# Test prerequisites | ||
- name: Start databases in test containers | ||
run: docker-compose -f docker-compose.ci.yml up -d | ||
- name: Check running containers | ||
run: docker ps -a | ||
- name: Check logs | ||
run: docker logs odbc-api_mssql_1 | ||
- name: Install SQL Server Driver | ||
run: | | ||
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | ||
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list | ||
apt-get update | ||
ACCEPT_EULA=Y apt-get install -y msodbcsql17 | ||
ln -s /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.*.so.* /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.so | ||
shell: sudo bash {0} | ||
- name: Copy test expectations | ||
run: cp odbcsv/tests/list-drivers-dev.txt odbcsv/tests/list-drivers.txt | ||
|
||
- name: Run grcov | ||
env: | ||
PROJECT_NAME: "odbc_api" | ||
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" | ||
RUSTDOCFLAGS: "-Cpanic=abort" | ||
CARGO_INCREMENTAL: 0 | ||
run: | | ||
cargo build --verbose | ||
cargo test --verbose | ||
zip -0 cov.zip $(find . -name "$PROJECT_NAME*.gc*" -print) | ||
grcov cov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" -o lcov.info | ||
- name: Push grcov results to Coveralls via GitHub Action | ||
uses: coverallsapp/github-action@v1.0.1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: "lcov.info" |