Repository navigation
142 lines (124 loc) · 5.96 KB
/
Copy pathcmake-errors.yml
File metadata and controls
142 lines (124 loc) · 5.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
name: CMake Errors
on: [push, pull_request]
jobs:
ci-cmake:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu GCC
os: ubuntu-latest
compiler: gcc
cflags: -Werror -Wall -Wextra
- name: Ubuntu GCC -O3
os: ubuntu-latest
compiler: gcc
cflags: -O3 -Werror -Wall -Wextra
- name: Ubuntu Clang
os: ubuntu-latest
compiler: clang
cflags: -Werror -Wall -Wextra
- name: Ubuntu Clang Debug
os: ubuntu-latest
compiler: clang
cflags: -Werror -Wall -Wextra
build-config: Debug
- name: Windows MSVC Win32
os: windows-latest
compiler: cl
cflags: /WX /W3
cmake-args: -A Win32
- name: Windows MSVC Win64
os: windows-latest
compiler: cl
cflags: /WX /W3 /wd4244 # fixes some warnings in http_parser.c which is not my code
cmake-args: -A x64
- name: Windows GCC
os: windows-latest
compiler: gcc
cflags: -Werror -Wall -Wextra
cmake-args: -G Ninja
- name: macOS Clang
os: macos-latest
compiler: clang
cflags: -Werror -Wall -Wextra
- name: macOS GCC
os: macos-latest
compiler: gcc
cflags: -Werror -Wall -Wextra
steps:
- name: Checkout repository
uses: actions/checkout@v7
# mulle-core and mulle-core-all-load used to be recursive git submodules
# under stash/. That recursive-submodule setup was removed, which left the
# two "build ... from stash/" steps below dangling (their working-directory
# no longer existed). Check them out explicitly instead, from the same ref
# as this build (github.ref_name, e.g. prerelease / develop / master).
- name: Checkout mulle-core into stash
uses: actions/checkout@v7
with:
repository: mulle-core/mulle-core
ref: ${{ github.ref_name }}
path: stash/mulle-core
- name: Checkout mulle-core-all-load into stash
uses: actions/checkout@v7
with:
repository: mulle-core/mulle-core-all-load
ref: ${{ github.ref_name }}
path: stash/mulle-core-all-load
# Set installation directory based on OS
- name: Set install directory
id: set-install-dir
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]
then
INSTALL_DIR="$GITHUB_WORKSPACE\\usr"
CMAKE_INSTALL_DIR="$(sed 's/\\/\//g' <<< "$INSTALL_DIR")" # sic, cygpath no good for cmake
MULLE_CORE_SRC_DIR="$GITHUB_WORKSPACE\\stash\\mulle-core"
MULLE_CORE_ALL_LOAD_SRC_DIR="$GITHUB_WORKSPACE\\stash\\mulle-core-all-load"
else
INSTALL_DIR="$GITHUB_WORKSPACE/usr"
CMAKE_INSTALL_DIR="${INSTALL_DIR}"
MULLE_CORE_SRC_DIR="$GITHUB_WORKSPACE/stash/mulle-core"
MULLE_CORE_ALL_LOAD_SRC_DIR="$GITHUB_WORKSPACE/stash/mulle-core-all-load"
fi
echo "INSTALL_DIR=$INSTALL_DIR" >> $GITHUB_OUTPUT
echo "CMAKE_INSTALL_DIR=$CMAKE_INSTALL_DIR" >> $GITHUB_OUTPUT
echo "MULLE_CORE_SRC_DIR=$MULLE_CORE_SRC_DIR" >> $GITHUB_OUTPUT
echo "MULLE_CORE_ALL_LOAD_SRC_DIR=$MULLE_CORE_ALL_LOAD_SRC_DIR" >> $GITHUB_OUTPUT
mkdir -p "$INSTALL_DIR"
- name: Configure, build and install mulle-core with CMake
working-directory: "${{steps.set-install-dir.outputs.MULLE_CORE_SRC_DIR}}"
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.cflags }}
run: |
cmake ${{ matrix.cmake-args }} -B build -DMULLE_SDK_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_INSTALL_PREFIX="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_PREFIX_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_BUILD_TYPE="${{ matrix.build-config || 'Release' }}"
cmake --build build --config "${{ matrix.build-config || 'Release' }}"
cmake --install build --config "${{ matrix.build-config || 'Release' }}"
- name: Configure, build and install mulle-core-all-load with CMake
working-directory: "${{steps.set-install-dir.outputs.MULLE_CORE_ALL_LOAD_SRC_DIR}}"
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.cflags }}
run: |
cmake ${{ matrix.cmake-args }} -B build -DMULLE_SDK_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_INSTALL_PREFIX="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_PREFIX_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_BUILD_TYPE="${{ matrix.build-config || 'Release' }}"
cmake --build build --config "${{ matrix.build-config || 'Release' }}"
cmake --install build --config "${{ matrix.build-config || 'Release' }}"
- name: Install packages (Windows)
if: runner.os == 'Windows'
run: |
choco install --no-progress ninja ${{ matrix.packages }}
- name: Generate project files
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.cflags }}
run: |
cmake ${{ matrix.cmake-args }} -B build -DMULLE_SDK_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_INSTALL_PREFIX="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_PREFIX_PATH="${{ steps.set-install-dir.outputs.CMAKE_INSTALL_DIR }}" -DCMAKE_BUILD_TYPE="${{ matrix.build-config || 'Release' }}"
- name: Compile source code
shell: bash
run: |
cmake --build "${{ matrix.build-dir || 'build' }}" --config "${{ matrix.build-config || 'Release' }}"