-
Notifications
You must be signed in to change notification settings - Fork 19
135 lines (130 loc) · 6.51 KB
/
ci.yml
File metadata and controls
135 lines (130 loc) · 6.51 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
name: CI Tests
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
pull_request:
schedule:
# minute hour day month day-of-week
# Run at 12:25 UTC every day
- cron: '25 12 * * *'
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ubuntu-24.04
container:
image: ghcr.io/bemanproject/testingcontainers-${{ matrix.config.tag }}
strategy:
fail-fast: false
matrix:
config:
- {name: "Ubuntu Clang 21", tag: "clang:21", toolchain: "clang-21", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" -DCMAKE_PREFIX_PATH=\"./infra/cmake\" "}
- {name: "Ubuntu Clang 20", tag: "clang:20", toolchain: "clang-20", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" -DCMAKE_PREFIX_PATH=\"./infra/cmake\" "}
# Note: clang-19 + Asan setup causes errors on some platforms. Temporary skip some checks via .asan_options.
- {name: "Ubuntu Clang 19", tag: "clang:19", toolchain: "clang-19", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" -DCMAKE_PREFIX_PATH=\"./infra/cmake\" ", asan_options: "new_delete_type_mismatch=0"}
- {name: "Ubuntu Clang 18", tag: "clang:18", toolchain: "clang-18", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" -DCMAKE_PREFIX_PATH=\"./infra/cmake\" "}
- {name: "Ubuntu Clang 17", tag: "clang:17", toolchain: "clang-17", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" -DCMAKE_PREFIX_PATH=\"./infra/cmake\" "}
- {name: "Ubuntu GCC 14", tag: "gcc:14", toolchain: "gcc-14", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan;Gcov\" -DCMAKE_PREFIX_PATH=\"./infra/cmake\" ", coverage: true}
- {name: "Ubuntu GCC 13", tag: "gcc:13", toolchain: "gcc-13", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" -DCMAKE_PREFIX_PATH=\"./infra/cmake\" "}
- {name: "Ubuntu GCC 12", tag: "gcc:12", toolchain: "gcc-12", cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" -DCMAKE_PREFIX_PATH=\"./infra/cmake\" "}
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
# If Clang 17, install a newer version of libc++ and libc++abi.
- name: Update packages
run: |
set -x
sudo apt update
sudo apt -y upgrade
- name: Install libc++
if: matrix.config.tag == 'clang:17'
run: |
set -x
sudo apt-get install -y libc++-dev libc++1 libc++abi-dev libc++abi1
find /usr/lib/x86_64-linux-gnu/ -name libc++.so* || true
- name: Install Gcovr
if: matrix.config.coverage
run: |
set -x
sudo apt-get install -y gcovr
- name: CMake Configure
run: |
set -x
echo ${{ matrix.config.cmake_args }}
echo ${{ matrix.config.toolchain }}
rm -rf .build
cmake ${{ matrix.config.cmake_args }} \
-DCMAKE_INSTALL_PREFIX=.install \
-DCMAKE_TOOLCHAIN_FILE="etc/${{ matrix.config.toolchain }}-toolchain.cmake" \
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="./cmake/use-fetch-content.cmake" \
-B .build \
-S .
- name: CMake ASAN Build
run: |
set -x
cmake --build .build --config Asan --target all_verify_interface_header_sets -- -k 0
cmake --build .build --config Asan --target all -- -k 0
- name: CMake ASAN Test
run: |
set -x
[[ ! -z "${{ matrix.config.asan_options }}" ]] && export ASAN_OPTIONS="${{ matrix.config.asan_options }}"
ctest --build-config Asan --output-on-failure --test-dir .build
- name: CMake RWDI Build
run: |
set -x
cmake --build .build --config RelWithDebInfo --target all_verify_interface_header_sets -- -k 0
cmake --build .build --config RelWithDebInfo --target all -- -k 0
- name: CMake RWDI Test
run: |
set -x
ctest --build-config RelWithDebInfo --output-on-failure --test-dir .build
- name: Install
run: |
set -x
cmake --install .build --config RelWithDebInfo --component beman_optional_development --verbose
- name: CMake Gcov Build
if: matrix.config.coverage
run: |
set -x
cmake --build .build --config Gcov --target all_verify_interface_header_sets -- -k 0
cmake --build .build --config Gcov --target all -- -k 0
- name: CMake Gcov Test
if: matrix.config.coverage
run: |
set -x
ctest --build-config Gcov --output-on-failure --test-dir .build
- name: Generate Coverage
if: matrix.config.coverage
run: |
set -x
cmake --build .build --config Gcov --target process_coverage -- -k 0
- name: Coveralls
if: matrix.config.coverage
uses: coverallsapp/github-action@main
with:
file: .build/coverage.json
github-token: ${{ secrets.GITHUB_TOKEN }}
create-issue-when-fault:
runs-on: ubuntu-latest
needs: [build]
if: failure() && github.event_name == 'schedule'
steps:
# See https://github.com/cli/cli/issues/5075
- uses: actions/checkout@v4
- name: Create issue
run: |
issue_num=$(gh issue list -s open -S "[SCHEDULED-BUILD] Build & Test failure" -L 1 --json number | jq 'if length == 0 then -1 else .[0].number end')
body="**Build-and-Test Failure Report**
- **Time of Failure**: $(date -u '+%B %d, %Y, %H:%M %Z')
- **Commit**: [${{ github.sha }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
- **Action Run**: [View logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
The scheduled build-and-test triggered by cron has failed.
Please investigate the logs and recent changes associated with this commit or rerun the workflow if you believe this is an error."
if [[ $issue_num -eq -1 ]]; then
gh issue create --repo ${{ github.repository }} --title "[SCHEDULED-BUILD] Build & Test failure" --body "$body"
else
gh issue comment --repo ${{ github.repository }} $issue_num --body "$body"
fi
env:
GH_TOKEN: ${{ github.token }}