-
Notifications
You must be signed in to change notification settings - Fork 76
94 lines (81 loc) · 2.68 KB
/
cmake.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
# Copyright (c) 2024 Sebastian Pipping <sebastian@pipping.org>
# Licensed under the 3-Clause BSD License
name: Build using CMake
# Drop permissions to minimum for security
permissions:
contents: read
on:
pull_request:
push:
schedule:
- cron: '0 3 * * 5' # Every Friday at 3am
workflow_dispatch:
jobs:
build_cmake:
name: CMake (${{ matrix.runs-on }}, ${{ matrix.cc }})
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
# FUSE 3 on Linux
- cc: gcc-14
clang_major_version: null
runs-on: ubuntu-24.04
- cc: clang-18
clang_major_version: 18
runs-on: ubuntu-24.04
# macFUSE on macOS
- cc: gcc-12
clang_major_version: null
runs-on: macos-13
- cc: clang-15
clang_major_version: 15
runs-on: macos-14
steps:
- name: Install build dependencies
if: "${{ runner.os == 'Linux' }}"
run: |-
sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
cmake \
libfuse3-dev \
pkg-config
- name: Add versioned aliases for Clang ${{ matrix.clang_major_version }}
if: "${{ runner.os == 'macOS' && contains(matrix.cc, 'clang') }}"
run: |-
set -x
sudo ln -s "$(brew --prefix llvm@${{ matrix.clang_major_version }})"/bin/clang /usr/local/bin/clang-${{ matrix.clang_major_version }}
- name: Install build dependencies
if: "${{ runner.os == 'macOS' }}"
run: |-
set -x
brew install --cask macfuse
- name: Checkout Git branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Configure with CMake'
run: |-
CFLAGS='-std=gnu99 -Wall -Wextra -pedantic'
LDFLAGS=
if [[ "${{ runner.os }}" = Linux || "${{ matrix.cc }}" = clang* ]]; then
CFLAGS+=' -g -fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer'
LDFLAGS+=' -g -fsanitize=address,undefined'
fi
cmake_args=(
-DCMAKE_C_COMPILER="${{ matrix.cc }}"
-DCMAKE_C_FLAGS="${CFLAGS}"
-DCMAKE_{EXE,MODULE,SHARED}_LINKER_FLAGS="${LDFLAGS}"
-S ./
-B build/
)
set -x
cmake "${cmake_args[@]}"
- name: 'Build'
run: |-
set -x
make -C build -j$(nproc) VERBOSE=1
- name: 'Install'
run: |-
set -x -o pipefail
make -C build install DESTDIR="${PWD}"/ROOT/
find ROOT/ | sort | xargs ls -ld