blob: a7d232eb7ce7eedc4cc12c2ab42ab0b82c5df520 (
plain) (
blame)
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
|
# Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org>
# Licensed under GPL v2 or later
name: Build and test
on:
pull_request:
push:
schedule:
- cron: '0 3 * * 5' # Every Friday at 3am
workflow_dispatch:
jobs:
linux:
name: Build (${{ matrix.cc }} and ${{ matrix.fuse_package }} on ${{ matrix.runs-on }})
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
# FUSE 2
- cc: gcc-13
cxx: g++-13
clang_major_version: null
clang_repo_suffix: null
runs-on: ubuntu-22.04
fuse_package: libfuse-dev
# FUSE 3
- cc: gcc-13
cxx: g++-13
clang_major_version: null
clang_repo_suffix: null
runs-on: ubuntu-22.04
fuse_package: libfuse3-dev
- cc: clang-17
cxx: clang++-17
clang_major_version: 17
clang_repo_suffix: -17
runs-on: ubuntu-22.04
fuse_package: libfuse3-dev
- cc: clang-18
cxx: clang++-18
clang_major_version: 18
clang_repo_suffix:
runs-on: ubuntu-22.04
fuse_package: libfuse3-dev
# fuse-t
- cc: gcc-13
cxx: g++-13
clang_major_version: null
clang_repo_suffix: null
runs-on: macos-12
fuse_package: fuse-t
# macFUSE
- cc: clang-15
cxx: clang++-15
clang_major_version: 15
clang_repo_suffix: null
runs-on: macos-12
fuse_package: macfuse
steps:
- name: Add Clang/LLVM repositories
if: "${{ runner.os == 'Linux' && contains(matrix.cxx, 'clang') }}"
run: |-
set -x
source /etc/os-release
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}${{ matrix.clang_repo_suffix }} main"
- name: Install build dependencies
if: "${{ runner.os == 'Linux' }}"
run: |-
sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
autoconf \
automake \
${{ matrix.fuse_package }} \
libtool \
pkg-config \
valgrind
- name: Install build dependencies
if: "${{ runner.os == 'macOS' }}"
run: |-
set -x
if [[ ${{ matrix.fuse_package }} = macfuse ]]; then
brew install --cask macfuse
elif [[ ${{ matrix.fuse_package }} = fuse-t ]]; then
brew tap macos-fuse-t/homebrew-cask
brew install fuse-t
else
false # should never get here
fi
brew install \
autoconf \
automake \
libtool \
pkg-config
- name: Install build dependency Clang ${{ matrix.clang_major_version }}
if: "${{ runner.os == 'Linux' && contains(matrix.cxx, 'clang') }}"
run: |-
sudo apt-get install --yes --no-install-recommends -V \
clang-${{ matrix.clang_major_version }}
- name: Add versioned aliases for Clang ${{ matrix.clang_major_version }}
if: "${{ runner.os == 'macOS' && contains(matrix.cxx, 'clang') }}"
run: |-
set -x
sudo ln -s "$(brew --prefix llvm@${{ matrix.clang_major_version }})"/bin/clang /usr/local/bin/clang-${{ matrix.clang_major_version }}
sudo ln -s "$(brew --prefix llvm@${{ matrix.clang_major_version }})"/bin/clang++ /usr/local/bin/clang++-${{ matrix.clang_major_version }}
- name: Checkout Git branch
uses: actions/checkout@v4
- name: 'Bootstrap with ./autogen.sh'
run: |-
./autogen.sh
- name: 'Configure'
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CFLAGS: -Werror
run: |-
set -x
./configure
- name: 'Build'
run: |-
set -x
make -j$(nproc || sysctl -n hw.logicalcpu) VERBOSE=1
- name: 'Test as non-root'
run: |-
if [[ ${{ runner.os }} = macOS ]]; then
ignore_errors=true # while unfixed
else
ignore_errors=false
fi
set -x
whoami
make check || ${ignore_errors}
- name: 'Test as root'
run: |-
if [[ ${{ runner.os }} = macOS ]]; then
ignore_errors=true # while unfixed
else
ignore_errors=false
fi
set -x
sudo make check || ${ignore_errors}
- name: 'Install'
run: |-
set -x -o pipefail
make install DESTDIR="${PWD}"/ROOT/
find ROOT/ | sort | xargs ls -ld
vagrant:
name: Run Vagrant tests
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# TODO: automatically check that this list is up-to-date
box:
- centos8
- debian10
- debian11
#- freebsd12 # https://github.com/mpartel/bindfs/issues/144#issuecomment-1807258383
- ubuntu1804
- ubuntu2004
- ubuntu2204
steps:
- name: Install dependencies
run: |-
set -x
for FILE in /etc/apt/sources.list /etc/apt/sources.list.d/*; do
if [[ -e "${FILE}" ]]; then
sudo sed -i 's/# deb-src /deb-src /' "${FILE}"
fi
done
# The following is based on these instructions:
# https://developer.hashicorp.com/vagrant/install?product_intent=vagrant
# https://vagrant-libvirt.github.io/vagrant-libvirt/installation.html
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt-get update
sudo apt-get build-dep vagrant ruby-libvirt
sudo apt-get install -y vagrant \
qemu-system-x86 \
autoconf automake libtool pkg-config \
qemu libvirt-daemon-system ebtables libguestfs-tools \
libxslt-dev libxml2-dev zlib1g-dev ruby-dev
vagrant plugin install vagrant-libvirt
sudo adduser "${USER}" libvirt
- name: Checkout Git branch
uses: actions/checkout@v4
- name: 'Generate build files with ./autogen.sh'
run: |-
./autogen.sh
- name: Check for KVM
run: |-
if [[ -e /dev/kvm ]]; then
echo "This GitHub Action runner has KVM. This run will be fast."
else
echo "This GitHub Action runner does NOT have KVM. This run will be slow."
fi
- name: Test with Vagrant box ${{ matrix.box }}
env:
VAGRANT_DEFAULT_PROVIDER: libvirt
run: |-
# sudo needed because the current shell is not yet in group "libvirt"
# https://github.com/actions/runner-images/discussions/5981
sudo -E -s -u "${USER}" vagrant/test.rb --print-logs ${{ matrix.box }}
|