-
-
Notifications
You must be signed in to change notification settings - Fork 22
82 lines (72 loc) · 3.04 KB
/
coverage.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: Coverage
on: [push, pull_request]
jobs:
coverage:
name: Generate & upload coverage report
runs-on: ubuntu-latest
# Database services used for testing
services:
# Microsoft SQL Server
sqlserver:
image: mcr.microsoft.com/mssql/server:2019-latest
ports:
- 1433:1433
env:
ACCEPT_EULA: Y
SA_PASSWORD: My@Test@Password1
# Maria DB test stopped working on Ubuntu after driver update
# Maria DB
# mariadb:
# image: mariadb
# ports:
# - 3306:3306
# env:
# MYSQL_ROOT_PASSWORD: my-secret-pw
# MYSQL_DATABASE: test_db
postgres:
image: postgres:15
ports:
- "5432:5432"
env:
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: test
steps:
- name: Checkout
uses: actions/checkout@v4
# LLVM tools preview is a requirement of cargo-llvm-cov
- name: Install llvm-tools-preview
run: rustup toolchain install stable --component llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Update package repostiory
run: sudo apt-get update
- name: Install PostgreSQL Driver
run: |
sudo apt-get install -y unixodbc-dev odbc-postgresql devscripts
# Fix PostgreSQL driver paths
sed --in-place 's/psqlodbca.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/psqlodbca.so/' /etc/odbcinst.ini
sed --in-place 's/psqlodbcw.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/psqlodbcw.so/' /etc/odbcinst.ini
shell: sudo bash {0}
- name: Install Microsoft ODBC Drivers
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
ACCEPT_EULA=Y apt-get install -y msodbcsql18
ln -s /opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.*.so.* /opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.so
apt-get install -y sqlite3 libsqliteodbc
sed --in-place 's/libsqlite3odbc.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/libsqlite3odbc.so/' /etc/odbcinst.ini
sed --in-place 's/libsqliteodbc.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/libsqliteodbc.so/' /etc/odbcinst.ini
# apt-get install -y odbc-mariadb
shell: sudo bash {0}
# Maria DB test currently do not run due to a packaging error of their odbc driver
- name: Generate coverage report
run: |
cargo llvm-cov --no-report -- --skip maria_db
cargo llvm-cov --features narrow --no-report -- --skip maria_db
cargo llvm-cov --no-run --lcov --output-path lcov.info
- name: Push coverage results to Coveralls
uses: coverallsapp/github-action@v2.3.4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "lcov.info"