-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (139 loc) · 4.96 KB
/
integration-tests.yml
File metadata and controls
158 lines (139 loc) · 4.96 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Integration Tests
on:
push:
branches: [ main, develop, feat/* ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
integration-tests:
name: ${{ matrix.os }} - ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Ubuntu 24.04 and macOS 14 for full C++20 std::format support
os: [ubuntu-24.04, macos-14]
build_type: [Debug, Release]
include:
- os: ubuntu-24.04
cc: gcc-13
cxx: g++-13
- os: macos-14
cc: clang
cxx: clang++
steps:
- name: Checkout database_system
uses: actions/checkout@v6
with:
submodules: recursive
- name: Checkout common_system
uses: actions/checkout@v6
with:
repository: kcenon/common_system
path: common_system
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
# Remove problematic Microsoft repositories that may cause 403 errors
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo rm -f /etc/apt/sources.list.d/azure-cli.list
sudo apt-get update
# Use GCC 13 for full C++20 std::format support
sudo apt-get install -y \
build-essential \
cmake \
ninja-build \
g++-13 \
libgtest-dev \
libsqlite3-dev \
lcov
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install \
cmake \
ninja \
googletest \
sqlite3 \
lcov
- name: Set up environment
run: |
echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV
- name: Build and install common_system
shell: bash
run: |
cd common_system
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DUSE_UNIT_TEST=OFF \
-DCMAKE_C_COMPILER=${{ matrix.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
cmake --build build --config Release
sudo cmake --install build --prefix /usr/local
- name: Configure CMake
run: |
cmake -B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER=${{ matrix.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DUSE_UNIT_TEST=ON \
-DDATABASE_BUILD_INTEGRATION_TESTS=ON \
-DUSE_SQLITE=ON \
-DALLOW_BUILD_WITHOUT_NETWORK_SYSTEM=ON \
-DCMAKE_CXX_FLAGS="--coverage -fprofile-arcs -ftest-coverage"
- name: Build integration tests
run: |
cmake --build build --target database_integration_tests -j $(nproc 2>/dev/null || sysctl -n hw.ncpu)
- name: Run integration tests
working-directory: build
run: |
./bin/database_integration_tests --gtest_output=xml:integration_test_results.xml
- name: Generate coverage report
if: matrix.build_type == 'Debug'
working-directory: build
run: |
# Ubuntu 22.04 lcov 1.14 only supports --ignore-errors: source
lcov --capture --directory . --output-file coverage.info --ignore-errors source --rc lcov_branch_coverage=0 2>/dev/null || \
lcov --capture --directory . --output-file coverage.info 2>/dev/null || true
if [ -f coverage.info ]; then
lcov --remove coverage.info '/usr/*' '*/tests/*' '*/gtest/*' '*/benchmark/*' \
--output-file coverage_filtered.info --ignore-errors source 2>/dev/null || true
if [ -f coverage_filtered.info ]; then
lcov --list coverage_filtered.info --ignore-errors source 2>/dev/null || echo "Coverage summary skipped"
fi
fi
- name: Upload coverage to Codecov
if: matrix.build_type == 'Debug' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v6
with:
files: ./build/coverage_filtered.info
flags: integration-tests
name: integration-tests-coverage
fail_ci_if_error: false
- name: Upload test results
if: always()
uses: actions/upload-artifact@v7
with:
name: integration-test-results-${{ matrix.os }}-${{ matrix.build_type }}
path: build/integration_test_results.xml
retention-days: 7
- name: Validate performance baselines
if: matrix.build_type == 'Release'
working-directory: build
run: |
# Run performance tests and check against baselines
./bin/database_integration_tests --gtest_filter=*Performance* --gtest_color=yes
integration-tests-summary:
name: Integration Tests Summary
needs: integration-tests
runs-on: ubuntu-24.04
if: always()
steps:
- name: Check integration test results
run: |
echo "Integration tests completed"
if [ "${{ needs.integration-tests.result }}" == "failure" ]; then
echo "Some integration tests failed"
exit 1
fi