forked from ivmai/bdwgc
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (121 loc) · 4.3 KB
/
build-release.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
126
127
128
129
130
131
# This workflow is for CMake-based build/test running on multiple platforms.
name: build release
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
name: ${{ matrix.os }} ${{ matrix.c_compiler }} thr:${{ matrix.enable_threads }} rwlock:${{ matrix.enable_rwlock }} redir:${{ matrix.redirect_malloc }} dll:${{ matrix.shared_libs }} cpp:${{ matrix.enable_cplusplus }}
runs-on: ${{ matrix.os }}
timeout-minutes: 6
strategy:
# Deliver the feedback for all matrix combinations.
fail-fast: false
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest, macos-12 ]
c_compiler: [ cl, clang, gcc ]
cxx_compiler: [ cl, clang++, g++ ]
enable_cplusplus: [ off, on ]
build_type: [ Release ]
disable_gc_debug: [ off ]
gc_assertions: [ on ]
large_config: [ on ]
enable_threads: [ on ]
enable_rwlock: [ on ]
redirect_malloc: [ on ]
shared_libs: [ on ]
exclude:
- os: macos-latest
c_compiler: cl
- os: macos-latest
c_compiler: gcc
- os: macos-12
c_compiler: cl
- os: macos-12
c_compiler: gcc
- os: ubuntu-latest
c_compiler: cl
- enable_threads: off
enable_rwlock: on
- c_compiler: cl
cxx_compiler: clang++
- c_compiler: cl
cxx_compiler: g++
- c_compiler: clang
cxx_compiler: cl
- c_compiler: clang
cxx_compiler: g++
- c_compiler: gcc
cxx_compiler: cl
- c_compiler: gcc
cxx_compiler: clang++
- os: macos-latest
enable_cplusplus: off
- os: macos-12
enable_cplusplus: off
- os: ubuntu-latest
enable_cplusplus: off
- os: windows-latest
c_compiler: cl
enable_cplusplus: off
- os: windows-latest # TODO: replacement operator cannot be inline
c_compiler: clang
enable_cplusplus: on
- os: windows-latest
c_compiler: gcc
enable_cplusplus: off
- os: windows-latest # TODO: support dependency on libatomic_ops
c_compiler: cl
enable_threads: on
include:
- os: windows-latest
c_compiler: gcc
cmake_generator_opt: '-G "Unix Makefiles"'
- os: windows-latest
c_compiler: clang
cmake_generator_opt: '-G "Unix Makefiles"'
steps:
- uses: actions/checkout@v4
- name: Set reusable strings
# Turn repeated input strings into step outputs.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
# Configure CMake in a 'build' subdirectory.
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
${{ matrix.cmake_generator_opt }}
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-Dbuild_tests=ON
-Ddisable_gc_debug=${{ matrix.disable_gc_debug }}
-Denable_cplusplus=${{ matrix.enable_cplusplus }}
-Denable_gc_assertions=${{ matrix.gc_assertions }}
-Denable_large_config=${{ matrix.large_config }}
-Denable_redirect_malloc=${{ matrix.redirect_malloc }}
-Denable_rwlock=${{ matrix.enable_rwlock }}
-Denable_threads=${{ matrix.enable_threads }}
-Denable_werror=ON
-Werror=dev
-S ${{ github.workspace }}
- name: Build
# Build the code with the given configuration.
run: >
cmake --build ${{ steps.strings.outputs.build-output-dir }}
--config ${{ matrix.build_type }} --verbose --parallel
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config ${{ matrix.build_type }} --verbose --parallel 8
- name: Upload artifacts
uses: actions/[email protected]
with:
name: ${{ matrix.os }}-${{ matrix.c_compiler }}-${{ matrix.cxx_compiler }}-${{ matrix.build_type }}-build
path: ${{ steps.strings.outputs.build-output-dir }}
if-no-files-found: error