Github Actions CI #205
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Github Actions CI | |
on: | |
pull_request: | |
schedule: | |
# Every friday | |
- cron: '0 0 * * 5' | |
jobs: | |
unit: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: Ubuntu | |
os: ubuntu-latest | |
- name: No FUSE | |
os: ubuntu-latest | |
disable_fuse: "--disable-fuse" | |
check_features: demo | |
- name: distcheck | |
os: ubuntu-latest | |
- name: Old distro | |
os: ubuntu-20.04 | |
- name: Mac | |
os: macos-latest | |
env: | |
CHECK_FEATURES: ${{ matrix.check_features }} | |
DISABLE_FUSE: ${{ matrix.disable_fuse }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: apt dependencies | |
run: > | |
sudo apt-get update && | |
sudo apt-get install -y automake autoconf libtool pkg-config | |
zlib1g-dev liblzo2-dev liblzma-dev liblz4-dev libzstd-dev | |
fio | |
if: runner.os == 'Linux' | |
- name: apt fuse 2 | |
run: sudo apt-get install -y libfuse-dev fuse | |
if: matrix.os == 'ubuntu-20.04' | |
- name: apt fuse 3 | |
run: sudo apt-get install -y libfuse3-dev fuse3 | |
if: matrix.os == 'ubuntu-latest' | |
- name: homebrew dependencies | |
env: | |
HOMEBREW_NO_AUTO_UPDATE: 1 | |
run: | | |
brew install autoconf automake libtool pkgconfig squashfs coreutils | |
brew install --cask macfuse | |
if: runner.os == 'macOS' | |
- name: configure | |
run: | | |
./autogen.sh | |
CPPFLAGS="-Werror" ./configure $DISABLE_FUSE | |
- name: build | |
run: | | |
make -j2 V=1 | |
if: matrix.name != 'distcheck' | |
- name: test | |
run: | | |
make check | |
diff -u ci/expected-features/${CHECK_FEATURES:-all} ci/features | |
if: runner.os != 'macOS' && matrix.name != 'distcheck' | |
- name: test mac | |
run: | | |
# On macOS loading the macfuse extension is needed. This | |
# command should load it without rebooting, except System | |
# Integrity Protection disallows it, so the tests get skipped | |
# there. This command came from | |
# https://github.com/actions/runner-images/issues/4731 | |
if sudo kextload /Library/Filesystems/macfuse.fs/Contents/Extensions/$(sw_vers -productVersion|cut -d. -f1)/macfuse.kext; then | |
make check | |
diff -u ci/expected-features/${CHECK_FEATURES:-all} ci/features | |
fi | |
if: runner.os == 'macOS' | |
- name: distcheck | |
run: | | |
make distcheck | |
if: matrix.name == 'distcheck' | |
- name: install | |
run: sudo make install | |
if: matrix.name != 'distcheck' | |
- name: output | |
run: | | |
cp /tmp/*.log . || true | |
mksquashfs > mksquashfs.log || true | |
if: always() | |
- name: upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: logs ${{ matrix.name }} | |
path: | | |
*.log | |
tests/*.log | |
ci/features | |
if: always() | |
windows: | |
runs-on: windows-2019 | |
steps: | |
- name: install chocolatey dependencies | |
shell: powershell | |
run: choco install -y squashfs | |
- name: setup msbuild | |
uses: microsoft/[email protected] | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: generate header | |
shell: bash | |
run: ./gen_swap.sh squashfs_fs.h | |
- name: build | |
working-directory: ./win | |
shell: powershell | |
run: MSBuild.exe squashfuse_ls.vcxproj -p:PlatformToolset=v142 | |
- name: test | |
working-directory: ./win | |
shell: bash | |
run: | | |
set -x | |
mkdir test | |
touch test/foo test/bar test/'iggy blah' | |
mksquashfs test test.squashfs | |
ls test | sort > expected | |
./Debug/squashfuse_ls.exe test.squashfs | dos2unix | sort > actual | |
diff -u expected actual |