2020-12-02 17:49:58 +00:00
#
# s3fs - FUSE-based file system backed by Amazon S3
#
# Copyright(C) 2007 Takeshi Nakatani <ggtakec.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
name : s3fs-fuse CI
on :
push :
pull_request :
#
# CRON event is fire on every sunday(UTC).
#
schedule :
- cron : '0 0 * * 0'
#
# Jobs
#
jobs :
Linux :
runs-on : ubuntu-latest
#
# build matrix for containers
#
strategy :
#
# do not stop jobs automatically if any of the jobs fail
#
fail-fast : false
#
# matrix for containers
#
matrix :
container :
2023-05-14 03:40:07 +00:00
- ubuntu:23.04
2022-06-22 08:40:08 +00:00
- ubuntu:22.04
2020-12-02 17:49:58 +00:00
- ubuntu:20.04
2022-01-09 03:11:00 +00:00
- debian:bullseye
2020-12-02 17:49:58 +00:00
- debian:buster
2022-11-21 14:13:53 +00:00
- rockylinux:9
2022-02-20 02:46:01 +00:00
- rockylinux:8
2020-12-02 17:49:58 +00:00
- centos:centos7
2023-05-14 04:41:12 +00:00
- fedora:38
2022-11-21 14:13:53 +00:00
- fedora:37
2020-12-02 17:49:58 +00:00
- opensuse/leap:15
2023-03-05 04:30:59 +00:00
- alpine:3.17
2020-12-02 17:49:58 +00:00
container :
image : ${{ matrix.container }}
options : "--privileged --cap-add SYS_ADMIN --device /dev/fuse"
env :
# [NOTE]
# Installation special environment variables for debian and ubuntu.
#
DEBIAN_FRONTEND : noninteractive
steps :
# [NOTE]
# On openSUSE, tar and gzip must be installed before action/checkout.
#
- name : Install packages before checkout
run : |
if [ "${{ matrix.container }}" = "opensuse/leap:15" ]; then zypper install -y tar gzip; fi
- name : Checkout source code
2022-11-05 06:08:42 +00:00
uses : actions/checkout@v3
2020-12-02 17:49:58 +00:00
# [NOTE]
# Matters that depend on OS:VERSION are determined and executed in the following script.
# Please note that the option to configure (CONFIGURE_OPTIONS) is set in the environment variable.
#
2022-01-03 10:50:13 +00:00
- name : Install packages
2020-12-02 17:49:58 +00:00
run : |
.github/workflows/linux-ci-helper.sh ${{ matrix.container }}
- name : Build
run : |
./autogen.sh
/bin/sh -c "./configure ${CONFIGURE_OPTIONS}"
2022-01-09 11:22:49 +00:00
make --jobs=$(nproc)
2020-12-02 17:49:58 +00:00
- name : Cppcheck
run : |
2023-07-23 03:50:05 +00:00
# specify the version range to run cppcheck (cppcheck version number is x.y or x.y.z)
2023-07-25 13:41:00 +00:00
if cppcheck --version | sed -e 's/\./ /g' | awk '{if (($2 * 1000 + $3) <= 1086) { exit(1) } }'; then
2022-01-23 14:10:09 +00:00
make cppcheck
fi
2020-12-02 17:49:58 +00:00
2022-01-15 17:08:46 +00:00
- name : Shellcheck
run : |
make shellcheck
2020-12-02 17:49:58 +00:00
- name : Test suite
run : |
2021-07-02 00:01:10 +00:00
make ALL_TESTS=1 check -C test || (test/filter-suite-log.sh test/test-suite.log; exit 1)
2020-12-02 17:49:58 +00:00
# [NOTE]
2023-05-08 11:28:41 +00:00
# This Job does not work for macOS 11 and later because load_osxfuse returns exit code = 1.
# Apple states "You must be signed in as an administrator user to install new kernel
# extensions, and your Mac must be rebooted for the extensions to load.", so it needs
# to reboot OS.
# As of May 2023, GitHub Actions are no longer able to launch macos 10.15 as runner,
# so we can not run this Job.
# In the future, if it is found a solution, we will resume this Job execution.
2020-12-02 17:49:58 +00:00
#
macos10 :
2023-05-08 11:28:41 +00:00
if : false
2020-12-02 17:49:58 +00:00
runs-on : macos-10.15
steps :
- name : Checkout source code
2022-11-05 06:08:42 +00:00
uses : actions/checkout@v3
2020-12-02 17:49:58 +00:00
- name : Brew tap
run : |
TAPS="$(brew --repository)/Library/Taps";
if [ -e "$TAPS/caskroom/homebrew-cask" ]; then rm -rf "$TAPS/caskroom/homebrew-cask"; fi;
2020-12-23 10:34:04 +00:00
HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/homebrew-cask
2020-12-02 17:49:58 +00:00
- name : Install osxfuse
run : |
2021-01-20 13:43:42 +00:00
HOMEBREW_NO_AUTO_UPDATE=1 brew install osxfuse
2020-12-02 17:49:58 +00:00
- name : Install brew other packages
run : |
2022-01-15 17:08:46 +00:00
S3FS_BREW_PACKAGES='automake cppcheck python3 coreutils gnu-sed shellcheck';
2020-12-02 17:49:58 +00:00
for s3fs_brew_pkg in ${S3FS_BREW_PACKAGES}; do if brew list | grep -q ${s3fs_brew_pkg}; then if brew outdated | grep -q ${s3fs_brew_pkg}; then HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade ${s3fs_brew_pkg}; fi; else HOMEBREW_NO_AUTO_UPDATE=1 brew install ${s3fs_brew_pkg}; fi; done;
2022-04-17 06:06:11 +00:00
- name : Install awscli2
2020-12-02 17:49:58 +00:00
run : |
2022-04-17 06:06:11 +00:00
cd /tmp
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
2020-12-02 17:49:58 +00:00
- name : Check osxfuse permission
run : |
if [ -f /Library/Filesystems/osxfusefs.fs/Support/load_osxfusefs ]; then sudo chmod +s /Library/Filesystems/osxfusefs.fs/Support/load_osxfusefs; elif [ -f /Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse ]; then sudo chmod +s /Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse; else exit 1; fi
- name : Build
run : |
./autogen.sh
2023-06-20 15:18:54 +00:00
PKG_CONFIG_PATH=/usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig ./configure CXXFLAGS='-std=c++11 -DS3FS_PTHREAD_ERRORCHECK=1'
2022-01-09 11:22:49 +00:00
make --jobs=$(sysctl -n hw.ncpu)
2020-12-02 17:49:58 +00:00
- name : Cppcheck
run : |
2023-07-23 03:50:05 +00:00
# specify the version range to run cppcheck (cppcheck version number is x.y or x.y.z)
2023-07-25 13:41:00 +00:00
if cppcheck --version | sed -e 's/\./ /g' | awk '{if (($2 * 1000 + $3) <= 1086) { exit(1) } }'; then
2023-07-23 03:50:05 +00:00
make cppcheck
fi
2020-12-02 17:49:58 +00:00
2022-01-15 17:08:46 +00:00
- name : Shellcheck
run : |
make shellcheck
2020-12-02 17:49:58 +00:00
- name : Test suite
run : |
make check -C src
echo "user_allow_other" | sudo tee -a /etc/fuse.conf >/dev/null
if [ -f /Library/Filesystems/osxfusefs.fs/Support/load_osxfusefs ]; then /Library/Filesystems/osxfusefs.fs/Support/load_osxfusefs; elif [ -f /Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse ]; then /Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse; else exit 1; fi
2021-07-01 23:41:47 +00:00
make ALL_TESTS=1 check -C test || (test/filter-suite-log.sh test/test-suite.log; exit 1)
2020-12-02 17:49:58 +00:00
2023-05-28 14:04:48 +00:00
MemoryTest :
runs-on : ubuntu-latest
#
# build matrix for containers
#
strategy :
#
# do not stop jobs automatically if any of the jobs fail
#
fail-fast : false
#
# matrix for type of checking
#
# [NOTE]
# Currently following test is not supported:
# - sanitize_memory : Future support planned
# - valgrind : Requires more than an hour of testing time
#
matrix :
checktype :
- glibc_debug
- sanitize_address
- sanitize_others
2023-06-25 14:13:49 +00:00
- sanitize_thread
2023-05-28 14:04:48 +00:00
container :
image : fedora:38
options : "--privileged --cap-add SYS_ADMIN --device /dev/fuse"
steps :
- name : Checkout source code
uses : actions/checkout@v3
- name : Install packages
run : |
.github/workflows/linux-ci-helper.sh fedora:38
- name : Install clang
run : |
dnf install -y clang
if [ "${{ matrix.checktype }}" = "valgrind" ]; then
dnf install -y valgrind
fi
#
# Set CXX/CXXFLAGS and Variables for test
#
- name : Set variables
run : |
COMMON_CXXFLAGS='-g -Wno-cpp -DS3FS_PTHREAD_ERRORCHECK=1'
if [ "${{ matrix.checktype }}" = "glibc_debug" ]; then
echo "CXXFLAGS=${COMMON_CXXFLAGS} -O0 -D_GLIBCXX_DEBUG" >> $GITHUB_ENV
elif [ "${{ matrix.checktype }}" = "sanitize_address" ]; then
echo 'CXX=clang++' >> $GITHUB_ENV
echo "CXXFLAGS=${COMMON_CXXFLAGS} -O0 -fsanitize=address -fsanitize-address-use-after-scope" >> $GITHUB_ENV
echo 'ASAN_OPTIONS=detect_leaks=1,detect_stack_use_after_return=1' >> $GITHUB_ENV
elif [ "${{ matrix.checktype }}" = "sanitize_memory" ]; then
echo 'CXX=clang++' >> $GITHUB_ENV
echo "CXXFLAGS=${COMMON_CXXFLAGS} -O0 -fsanitize=memory" >> $GITHUB_ENV
elif [ "${{ matrix.checktype }}" = "sanitize_thread" ]; then
echo 'CXX=clang++' >> $GITHUB_ENV
echo "CXXFLAGS=${COMMON_CXXFLAGS} -O0 -fsanitize=thread" >> $GITHUB_ENV
echo 'TSAN_OPTIONS=halt_on_error=1' >> $GITHUB_ENV
elif [ "${{ matrix.checktype }}" = "sanitize_others" ]; then
echo 'CXX=clang++' >> $GITHUB_ENV
echo "CXXFLAGS=${COMMON_CXXFLAGS} -O1 -fsanitize=undefined,implicit-conversion,local-bounds,unsigned-integer-overflow" >> $GITHUB_ENV
elif [ "${{ matrix.checktype }}" = "valgrind" ]; then
echo "CXXFLAGS=${COMMON_CXXFLAGS} -O1" >> $GITHUB_ENV
echo 'VALGRIND=--leak-check=full' >> $GITHUB_ENV
echo 'RETRIES=100' >> $GITHUB_ENV
fi
- name : Build
run : |
./autogen.sh
/bin/sh -c "CXX=${CXX} CXXFLAGS=\"${CXXFLAGS}\" ./configure --prefix=/usr --with-openssl"
make
- name : Test suite
run : |
/bin/sh -c "ALL_TESTS=1 ASAN_OPTIONS=${ASAN_OPTIONS} TSAN_OPTIONS=${TSAN_OPTIONS} VALGRIND=${VALGRIND} RETRIES=${RETRIES} make check -C test || (test/filter-suite-log.sh test/test-suite.log; exit 1)"
2020-12-02 17:49:58 +00:00
#
# Local variables:
# tab-width: 4
# c-basic-offset: 4
# End:
# vim600: expandtab sw=4 ts=4 fdm=marker
# vim<600: expandtab sw=4 ts=4
#