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-10-22 13:18:29 +00:00
- ubuntu:23.10
2022-06-22 08:40:08 +00:00
- ubuntu:22.04
2020-12-02 17:49:58 +00:00
- ubuntu:20.04
2023-06-30 11:42:51 +00:00
- debian:bookworm
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
2024-05-11 00:25:05 +00:00
- fedora:40
2023-11-12 07:01:09 +00:00
- fedora:39
2020-12-02 17:49:58 +00:00
- opensuse/leap:15
2024-03-06 15:23:00 +00:00
- alpine:3.19
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
2024-02-07 10:51:17 +00:00
# [NOTE]
# actions/checkout@v3 uses nodejs v16 and will be deprecated.
# However, @v4 does not work on centos7 depending on the glibc version,
# so we will continue to use @v3.
#
- name : Checkout source code(other than centos7)
if : matrix.container != 'centos:centos7'
uses : actions/checkout@v4
- name : Checkout source code(only centos7)
if : matrix.container == 'centos:centos7'
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
2023-08-17 13:42:11 +00:00
- name : clang-tidy
run : |
# skip if clang-tidy does not exist, e.g., CentOS 7
if command -v clang-tidy; then
make -C src/ clang-tidy
make -C test/ clang-tidy
fi
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-08-17 13:08:56 +00:00
if cppcheck --version | sed -e 's/\./ /g' | awk '{if (($2 * 1000 + $3) <= 2004) { 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 : |
2023-09-24 09:32:07 +00:00
if shellcheck --version | awk -F '[ .]' '/version:/ && ($2 * 1000 + $3 <= 7) { exit(1) }'; then
make shellcheck
fi
2022-01-15 17:08:46 +00:00
2020-12-02 17:49:58 +00:00
- name : Test suite
run : |
2023-08-15 14:15:53 +00:00
make check -C src
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-06-25 10:11:36 +00:00
# Using macos-fuse-t
# This product(package) is a workaround for osxfuse which required an OS reboot(macos 11 and later).
# see. https://github.com/macos-fuse-t/fuse-t
# About osxfuse
# This job doesn't work with Github Actions using macOS 11+ because "load_osxfuse" returns
# "exit code = 1".(requires OS reboot)
2020-12-02 17:49:58 +00:00
#
2023-06-25 10:11:36 +00:00
macos12 :
runs-on : macos-12
2020-12-02 17:49:58 +00:00
steps :
- name : Checkout source code
2024-02-07 10:51:17 +00:00
uses : actions/checkout@v4
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
2023-06-25 10:11:36 +00:00
HOMEBREW_NO_AUTO_UPDATE=1 brew tap macos-fuse-t/homebrew-cask
2020-12-02 17:49:58 +00:00
2023-06-25 10:11:36 +00:00
- name : Install fuse-t
2020-12-02 17:49:58 +00:00
run : |
2023-06-25 10:11:36 +00:00
HOMEBREW_NO_AUTO_UPDATE=1 brew install fuse-t
2020-12-02 17:49:58 +00:00
- name : Install brew other packages
run : |
2023-06-25 10:11:36 +00:00
S3FS_BREW_PACKAGES='automake cppcheck python3 coreutils gnu-sed shellcheck jq';
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 : 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-08-17 13:08:56 +00:00
if cppcheck --version | sed -e 's/\./ /g' | awk '{if (($2 * 1000 + $3) <= 2004) { 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 : |
2023-09-24 09:32:07 +00:00
if shellcheck --version | awk -F '[ .]' '/version:/ && ($2 * 1000 + $3 <= 7) { exit(1) }'; then
make shellcheck
fi
2022-01-15 17:08:46 +00:00
2020-12-02 17:49:58 +00:00
- name : Test suite
run : |
make check -C src
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
#
matrix :
checktype :
- glibc_debug
- sanitize_address
- sanitize_others
2023-06-25 14:13:49 +00:00
- sanitize_thread
2023-08-29 14:11:26 +00:00
- valgrind
2023-05-28 14:04:48 +00:00
container :
2024-05-11 00:25:05 +00:00
image : fedora:40
2023-05-28 14:04:48 +00:00
options : "--privileged --cap-add SYS_ADMIN --device /dev/fuse"
steps :
- name : Checkout source code
2024-02-07 10:51:17 +00:00
uses : actions/checkout@v4
2023-05-28 14:04:48 +00:00
- name : Install packages
run : |
2024-05-11 00:25:05 +00:00
.github/workflows/linux-ci-helper.sh fedora:40
2023-05-28 14:04:48 +00:00
- 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
2024-03-17 13:56:25 +00:00
# [NOTE]
# Set this to avoid following error when running configure.
# "FATAL: ThreadSanitizer: unexpected memory mapping"
sysctl vm.mmap_rnd_bits=28
2023-05-28 14:04:48 +00:00
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
2023-08-29 14:11:26 +00:00
echo 'S3_URL=http://127.0.0.1:8081' >> $GITHUB_ENV
2023-05-28 14:04:48 +00:00
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
#