|
| 1 | +# |
| 2 | +# s3fs - FUSE-based file system backed by Amazon S3 |
| 3 | +# |
| 4 | +# Copyright(C) 2007 Takeshi Nakatani <ggtakec.com> |
| 5 | +# |
| 6 | +# This program is free software; you can redistribute it and/or |
| 7 | +# modify it under the terms of the GNU General Public License |
| 8 | +# as published by the Free Software Foundation; either version 2 |
| 9 | +# of the License, or (at your option) any later version. |
| 10 | +# |
| 11 | +# This program is distributed in the hope that it will be useful, |
| 12 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +# GNU General Public License for more details. |
| 15 | +# |
| 16 | +# You should have received a copy of the GNU General Public License |
| 17 | +# along with this program; if not, write to the Free Software |
| 18 | +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 19 | +# |
| 20 | + |
| 21 | +name: s3fs-fuse CI |
| 22 | + |
| 23 | +on: |
| 24 | + push: |
| 25 | + pull_request: |
| 26 | + # |
| 27 | + # CRON event is fire on every sunday(UTC). |
| 28 | + # |
| 29 | + schedule: |
| 30 | + - cron: '0 0 * * 0' |
| 31 | + |
| 32 | +# |
| 33 | +# Jobs |
| 34 | +# |
| 35 | +jobs: |
| 36 | + Linux: |
| 37 | + runs-on: ubuntu-latest |
| 38 | + |
| 39 | + # |
| 40 | + # build matrix for containers |
| 41 | + # |
| 42 | + strategy: |
| 43 | + # |
| 44 | + # do not stop jobs automatically if any of the jobs fail |
| 45 | + # |
| 46 | + fail-fast: false |
| 47 | + |
| 48 | + # |
| 49 | + # matrix for containers |
| 50 | + # |
| 51 | + matrix: |
| 52 | + container: |
| 53 | + - ubuntu:21.10 |
| 54 | + - ubuntu:20.04 |
| 55 | + - ubuntu:18.04 |
| 56 | + - debian:bullseye |
| 57 | + - debian:buster |
| 58 | + - debian:stretch |
| 59 | + - rockylinux:8 |
| 60 | + - centos:centos7 |
| 61 | + - fedora:35 |
| 62 | + - opensuse/leap:15 |
| 63 | + |
| 64 | + container: |
| 65 | + image: ${{ matrix.container }} |
| 66 | + |
| 67 | + options: "--privileged --cap-add SYS_ADMIN --device /dev/fuse" |
| 68 | + |
| 69 | + env: |
| 70 | + # [NOTE] |
| 71 | + # Installation special environment variables for debian and ubuntu. |
| 72 | + # |
| 73 | + DEBIAN_FRONTEND: noninteractive |
| 74 | + |
| 75 | + steps: |
| 76 | + # [NOTE] |
| 77 | + # On openSUSE, tar and gzip must be installed before action/checkout. |
| 78 | + # |
| 79 | + - name: Install packages before checkout |
| 80 | + run: | |
| 81 | + if [ "${{ matrix.container }}" = "opensuse/leap:15" ]; then zypper install -y tar gzip; fi |
| 82 | +
|
| 83 | + - name: Checkout source code |
| 84 | + uses: actions/checkout@v2 |
| 85 | + |
| 86 | + # [NOTE] |
| 87 | + # Matters that depend on OS:VERSION are determined and executed in the following script. |
| 88 | + # Please note that the option to configure (CONFIGURE_OPTIONS) is set in the environment variable. |
| 89 | + # |
| 90 | + - name: Install packages |
| 91 | + run: | |
| 92 | + .github/workflows/linux-ci-helper.sh ${{ matrix.container }} |
| 93 | +
|
| 94 | + - name: Build |
| 95 | + run: | |
| 96 | + ./autogen.sh |
| 97 | + /bin/sh -c "./configure ${CONFIGURE_OPTIONS}" |
| 98 | + make --jobs=$(nproc) |
| 99 | +
|
| 100 | + - name: Cppcheck |
| 101 | + run: | |
| 102 | + # work around resource leak false positives on older Linux distributions |
| 103 | + if cppcheck --version | awk '{if ($2 <= 1.86) { exit(1) } }'; then |
| 104 | + make cppcheck |
| 105 | + fi |
| 106 | +
|
| 107 | + - name: Shellcheck |
| 108 | + run: | |
| 109 | + make shellcheck |
| 110 | +
|
| 111 | + - name: Test suite |
| 112 | + run: | |
| 113 | + make ALL_TESTS=1 check -C test || (test/filter-suite-log.sh test/test-suite.log; exit 1) |
| 114 | +
|
| 115 | + # [NOTE] |
| 116 | + # A case of "runs-on: macos-11.0" does not work, |
| 117 | + # because load_osxfuse returns exit code = 1. |
| 118 | + # Maybe it needs to reboot. Apple said |
| 119 | + # "Installing a new kernel extension requires signing in as an Admin user. You must also restart your Mac to load the extension". |
| 120 | + # Then we do not use macos 11 on GitHub Actions now. |
| 121 | + # |
| 122 | + macos10: |
| 123 | + runs-on: macos-10.15 |
| 124 | + |
| 125 | + steps: |
| 126 | + - name: Checkout source code |
| 127 | + uses: actions/checkout@v2 |
| 128 | + |
| 129 | + - name: Brew tap |
| 130 | + run: | |
| 131 | + TAPS="$(brew --repository)/Library/Taps"; |
| 132 | + if [ -e "$TAPS/caskroom/homebrew-cask" ]; then rm -rf "$TAPS/caskroom/homebrew-cask"; fi; |
| 133 | + HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/homebrew-cask |
| 134 | +
|
| 135 | + - name: Install osxfuse |
| 136 | + run: | |
| 137 | + HOMEBREW_NO_AUTO_UPDATE=1 brew install osxfuse |
| 138 | +
|
| 139 | + - name: Install brew other packages |
| 140 | + run: | |
| 141 | + S3FS_BREW_PACKAGES='automake cppcheck python3 coreutils gnu-sed shellcheck'; |
| 142 | + 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; |
| 143 | +
|
| 144 | + - name: Install awscli |
| 145 | + run: | |
| 146 | + if pip3 --version; then pip3 install awscli; else curl https://bootstrap.pypa.io/get-pip.py | sudo python; pip install awscli --ignore-installed matplotlib; fi |
| 147 | +
|
| 148 | + - name: Check osxfuse permission |
| 149 | + run: | |
| 150 | + 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 |
| 151 | +
|
| 152 | + - name: Build |
| 153 | + run: | |
| 154 | + ./autogen.sh |
| 155 | + PKG_CONFIG_PATH=/usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig ./configure CXXFLAGS='-std=c++03 -DS3FS_PTHREAD_ERRORCHECK=1' |
| 156 | + make --jobs=$(sysctl -n hw.ncpu) |
| 157 | +
|
| 158 | + - name: Cppcheck |
| 159 | + run: | |
| 160 | + make cppcheck |
| 161 | +
|
| 162 | + - name: Shellcheck |
| 163 | + run: | |
| 164 | + make shellcheck |
| 165 | +
|
| 166 | + - name: Test suite |
| 167 | + run: | |
| 168 | + make check -C src |
| 169 | + echo "user_allow_other" | sudo tee -a /etc/fuse.conf >/dev/null |
| 170 | + 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 |
| 171 | + make ALL_TESTS=1 check -C test || (test/filter-suite-log.sh test/test-suite.log; exit 1) |
| 172 | +
|
| 173 | +# |
| 174 | +# Local variables: |
| 175 | +# tab-width: 4 |
| 176 | +# c-basic-offset: 4 |
| 177 | +# End: |
| 178 | +# vim600: expandtab sw=4 ts=4 fdm=marker |
| 179 | +# vim<600: expandtab sw=4 ts=4 |
| 180 | +# |
0 commit comments