name: build on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - cc: gcc extra: "" - cc: gcc extra: "--enable-warnings" - cc: clang extra: "" # clang builds warning-free with -Wall -Wextra; keep this job as # the regression gate for that guarantee. - cc: clang extra: "--enable-warnings" - cc: gcc extra: "--enable-io-failure-emulation" env: CC: ${{ matrix.cc }} steps: - uses: actions/checkout@v4 - name: Install build dependencies run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ autoconf automake libtool pkg-config \ libcom-err-dev uuid-dev \ build-essential clang - name: Bootstrap run: ./autogen.sh - name: Configure run: ./configure ${{ matrix.extra }} - name: Build run: make -j"$(nproc)" - name: Fail on any compiler warning if: matrix.extra == '--enable-warnings' run: | make -j"$(nproc)" clean >/dev/null 2>&1 || true make -j"$(nproc)" > build.log 2>&1 || { cat build.log; exit 1; } if grep -q "warning:" build.log; then grep "warning:" build.log echo "build is not -Wall -Wextra clean" exit 1 fi - name: Smoke test run: | set -e dd if=/dev/zero of=smoke.img bs=1M count=64 status=none ./mkreiserfs/mkreiserfs -f -q smoke.img ./fsck/reiserfsck --check -f -q -y smoke.img ./debugreiserfs/debugreiserfs -S smoke.img out-of-tree: # Parallel builds from a separate build directory; historically this # tripped the compile_et target race, so keep it covered. runs-on: ubuntu-latest env: CC: gcc steps: - uses: actions/checkout@v4 - name: Install build dependencies run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ autoconf automake libtool pkg-config \ libcom-err-dev uuid-dev build-essential - name: Bootstrap run: ./autogen.sh - name: Configure (out-of-tree) run: | mkdir -p "$RUNNER_TEMP/rfs-build" cd "$RUNNER_TEMP/rfs-build" "$GITHUB_WORKSPACE/configure" --enable-warnings - name: Build run: make -C "$RUNNER_TEMP/rfs-build" -j"$(nproc)" - name: Smoke test run: | set -e cd "$RUNNER_TEMP/rfs-build" dd if=/dev/zero of=smoke.img bs=1M count=64 status=none ./mkreiserfs/mkreiserfs -f -q smoke.img ./fsck/reiserfsck --check -f -q -y smoke.img sanitizers: # clang + AddressSanitizer + UndefinedBehaviorSanitizer over the real # tool paths (format, check, resize, rollback). Leak detection is off: # the one-shot tools deliberately keep process-lifetime allocations. runs-on: ubuntu-latest env: CC: clang steps: - uses: actions/checkout@v4 - name: Install build dependencies run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ autoconf automake libtool pkg-config \ libcom-err-dev uuid-dev build-essential clang - name: Bootstrap run: ./autogen.sh - name: Configure with sanitizers run: > ./configure --enable-warnings CFLAGS="-g -O1 -fsanitize=address,undefined -fno-omit-frame-pointer" - name: Build run: make -j"$(nproc)" - name: Exercise tools under sanitizers env: ASAN_OPTIONS: detect_leaks=0:halt_on_error=1 UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1 run: | set -e dd if=/dev/zero of=/tmp/s.img bs=1M count=64 status=none ./mkreiserfs/mkreiserfs -f -q -l SAN /tmp/s.img ./fsck/reiserfsck --check -f -q -y /tmp/s.img ./debugreiserfs/debugreiserfs -S /tmp/s.img ./tune/reiserfstune -l SAN2 -f /tmp/s.img # resize: 64M -> 128M dd if=/dev/zero of=/tmp/b.img bs=1M count=64 status=none ./mkreiserfs/mkreiserfs -f -q /tmp/b.img truncate -s 128M /tmp/b.img ./resize_reiserfs/resize_reiserfs -s +64M -f /tmp/b.img ./fsck/reiserfsck --check -f -q -y /tmp/b.img # rollback save + restore cp /tmp/s.img /tmp/r.img ./fsck/reiserfsck --fix-fixable -y -q -R /tmp/rb.dat /tmp/r.img ./fsck/reiserfsck --rollback-fsck-changes -y -q -R /tmp/rb.dat /tmp/r.img # rollback file with garbage magic must be rejected head -c 100 /dev/urandom > /tmp/bad.dat if ./fsck/reiserfsck --rollback-fsck-changes -y -q -R /tmp/bad.dat /tmp/r.img 2>&1 \ | grep -q "does not look like a rollback file"; then echo "rollback garbage correctly rejected" else echo "rollback garbage was NOT rejected" exit 1 fi