-
Notifications
You must be signed in to change notification settings - Fork 4
126 lines (109 loc) · 3.66 KB
/
ubuntu-22.04-apt.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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: ubuntu-apt
on:
pull_request:
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VCPKG_FEATURE_FLAGS: dependencygraph
jobs:
test:
runs-on: ubuntu-22.04
services:
mariadb:
image: mariadb
env:
MARIADB_ROOT_HOST: '%'
MARIADB_USER: libsese
MARIADB_PASSWORD: libsese
MARIADB_ROOT_PASSWORD: libsese
ports:
- '127.0.0.1:18806:3306'
postgresql:
image: postgres
env:
POSTGRES_PASSWORD: libsese
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- '127.0.0.1:18080:5432'
steps:
- name: Checkout
uses: actions/checkout@v4.1.2
- name: Setup Python
uses: actions/setup-python@v5.1.0
with:
python-version: '3.11'
- name: Setup Database
working-directory: ${{ github.workspace }}
env:
PGPASSWORD: libsese
run: |
mysql -uroot -plibsese -h 127.0.0.1 -P 18806 < ./scripts/mysql_dump.sql
psql -U postgres -d postgres -h 127.0.0.1 -p 18080 -f ./scripts/postgres_dump.sql
mkdir build
sqlite3 build/db_test.db < scripts/sqlite_dump.sql
- name: Setup pip
run: pip install -r ${{ github.workspace }}/requirements.txt
- name: Setup deps
working-directory: ${{ github.workspace }}
run: sudo ./scripts/install_ubuntu_deps.sh
- name: Configure CMake
working-directory: ${{ github.workspace }}
run: >
cmake
-DCMAKE_BUILD_TYPE=Release
-DSESE_BUILD_TEST=ON
-DSESE_USE_NATIVE_MANAGER=ON
-DSESE_USE_ARCHIVE=ON
-DSESE_DB_USE_MARIADB=ON
-DSESE_DB_USE_POSTGRES=ON
-DSESE_DB_MYSQL_CONNECTION_STRING="host=127.0.0.1\;port=18806\;user=root\;pwd=libsese\;db=db_test\;"
-DSESE_DB_PSQL_CONNECTION_STRING="host=127.0.0.1\;port=18080\;user=postgres\;pwd=libsese\;db=db_test\;"
-DSESE_DB_SQLITE_CONNECTION_STRING="${{ github.workspace }}/build/db_test.db"
-DCMAKE_CXX_FLAGS="--coverage -fprofile-update=atomic"
-Bbuild
- name: Build
working-directory: ${{ github.workspace }}
run: cmake --build build -- -j 2
- name: Test
working-directory: ${{ github.workspace }}
run: build/sese/test/AllTestsInMain --gtest_output="xml:build/test_report.xml"
- name: Test report
uses: dorny/test-reporter@v1.9.1
if: success() || failure()
with:
name: JEST Tests on Ubuntu
path: build/test_report.xml
reporter: jest-junit
- name: Coverage
working-directory: ${{ github.workspace }}
run: |
mkdir -p build/coverage/html
gcovr --config gcovr-html.cfg
gcovr --config gcovr-cobertura.cfg
- name: Code Coverage Summary Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: build/coverage/coverage.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '60 80'
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: ${{ github.workspace }}/build/coverage