forked from bytedance/sonic-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
161 lines (138 loc) · 4.32 KB
/
Copy pathtest_x86.yml
File metadata and controls
161 lines (138 loc) · 4.32 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
159
160
161
name: CI / Test (x86)
permissions:
contents: read
actions: write
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
branches: [ master ]
paths-ignore:
- 'docs/**'
- 'licenses/**'
- '**/*.md'
- 'Doxyfile'
- '.vscode/**'
pull_request:
workflow_dispatch:
jobs:
test-llvm:
name: clang ${{ matrix.llvm_version }} / ${{ matrix.tool }} / ${{ matrix.arch }}
runs-on: ubuntu-24.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
llvm_version: ['11', '16.0.4', '17']
tool: ['cmake', 'bazel']
arch: [westmere, haswell]
exclude:
- tool: 'cmake'
arch: westmere
env:
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@v4
- name: Read Bazel version
if: matrix.tool == 'bazel'
run: |
echo "BAZEL_VERSION=$(cat .bazelversion)" >> "$GITHUB_ENV"
- name: Cache Bazel
if: matrix.tool == 'bazel'
uses: actions/cache@v4
with:
path: |
~/.cache/bazel
~/.cache/bazelisk
key: ${{ runner.os }}-bazel-${{ env.BAZEL_VERSION }}-${{ hashFiles('MODULE.bazel.lock', 'WORKSPACE.bzlmod', 'BUILD.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-${{ env.BAZEL_VERSION }}-
${{ runner.os }}-bazel-
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: ${{ matrix.llvm_version }}
- name: Setup bazel
if: matrix.tool == 'bazel'
uses: jwlawson/actions-setup-bazel@v2
with:
bazel-version: "${{ env.BAZEL_VERSION }}"
- name: Setup cmake
if: matrix.tool == 'cmake'
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: "3.31.10"
- name: Run ${{ matrix.arch }} Test Use Bazel
if: matrix.tool == 'bazel'
run: |
bash ./scripts/unittest.sh -c --arch=${{ matrix.arch }}
- name: Run Test Use CMake
if: matrix.tool == 'cmake'
run: |
bash ./scripts/run_cmake.sh
test-gcc:
name: gcc ${{ matrix.gcc_version }} / ${{ matrix.tool }} / ${{ matrix.arch }} / ${{ matrix.dispatch }}
runs-on: ubuntu-24.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
gcc_version: ['9', '12']
tool: ['cmake', 'bazel']
arch: [westmere, haswell]
dispatch: [static, dynamic]
exclude:
- tool: 'bazel'
arch: haswell
dispatch: dynamic
- tool: 'cmake'
dispatch: dynamic
- tool: 'cmake'
arch: westmere
env:
CC: gcc-${{ matrix.gcc_version }}
CXX: g++-${{ matrix.gcc_version}}
steps:
- uses: actions/checkout@v4
- name: Read Bazel version
if: matrix.tool == 'bazel'
run: |
echo "BAZEL_VERSION=$(cat .bazelversion)" >> "$GITHUB_ENV"
- name: Install GCC
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc-${{ matrix.gcc_version }} g++-${{ matrix.gcc_version }}
- name: Cache Bazel
if: matrix.tool == 'bazel'
uses: actions/cache@v4
with:
path: |
~/.cache/bazel
~/.cache/bazelisk
key: ${{ runner.os }}-bazel-${{ env.BAZEL_VERSION }}-${{ hashFiles('MODULE.bazel.lock', 'WORKSPACE.bzlmod', 'BUILD.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-${{ env.BAZEL_VERSION }}-
${{ runner.os }}-bazel-
- name: Setup bazel
if: matrix.tool == 'bazel'
uses: jwlawson/actions-setup-bazel@v2
with:
bazel-version: "${{ env.BAZEL_VERSION }}"
- name: Setup cmake
if: matrix.tool == 'cmake'
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: "3.31.10"
- name: Run ${{ matrix.arch }} ${{ matrix.dispatch }} Test Use Bazel
if: matrix.tool == 'bazel'
run: |
bash ./scripts/unittest.sh -g --arch=${{ matrix.arch }} --dispatch=${{ matrix.dispatch }}
- name: Run Test Use CMake
if: matrix.tool == 'cmake'
run: |
bash ./scripts/run_cmake.sh