diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/codeql.yml | 4 | ||||
-rwxr-xr-x | .github/diag.sh | 20 | ||||
-rw-r--r-- | .github/workflows/ci.yml | 149 | ||||
-rw-r--r-- | .github/workflows/codecov.yml | 7 | ||||
-rw-r--r-- | .github/workflows/codeql.yml | 4 |
5 files changed, 130 insertions, 54 deletions
diff --git a/.github/codeql.yml b/.github/codeql.yml index 6ff8337..a4271ec 100644 --- a/.github/codeql.yml +++ b/.github/codeql.yml @@ -2,8 +2,12 @@ query-filters: - exclude: id: cpp/commented-out-code - exclude: + id: cpp/include-non-header + - exclude: id: cpp/long-switch - exclude: id: cpp/loop-variable-changed - exclude: id: cpp/poorly-documented-function + - exclude: + id: cpp/constant-comparison diff --git a/.github/diag.sh b/.github/diag.sh new file mode 100755 index 0000000..d89e7a4 --- /dev/null +++ b/.github/diag.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# Copyright © Tavian Barnes <tavianator@tavianator.com> +# SPDX-License-Identifier: 0BSD + +# Convert compiler diagnostics to GitHub Actions messages +# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message + +set -eu + +SEDFLAGS="-En" +if sed -u 's/s/s/' </dev/null &>/dev/null; then + SEDFLAGS="${SEDFLAGS}u" +fi + +filter() { + sed $SEDFLAGS 'p; s/^([^:]*):([^:]*):([^:]*): (warning|error): (.*)$/::\4 file=\1,line=\2,col=\3,title=Compiler \4::\5/p' +} + +exec "$@" > >(filter) 2> >(filter >&2) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3890bb0..4075eb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,10 +3,12 @@ name: CI on: [push, pull_request] jobs: - linux: - name: Linux + linux-x86: + name: Linux (x86) + runs-on: ubuntu-24.04 - runs-on: ubuntu-22.04 + # Don't run on both pushes and pull requests + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name steps: - uses: actions/checkout@v4 @@ -16,7 +18,7 @@ jobs: sudo dpkg --add-architecture i386 sudo apt-get update -y sudo apt-get install -y \ - expect \ + mandoc \ gcc-multilib \ libgcc-s1:i386 \ acl \ @@ -34,112 +36,157 @@ jobs: sudo ln -s libacl.so.1 /lib/i386-linux-gnu/libacl.so sudo ln -s libcap.so.2 /lib/i386-linux-gnu/libcap.so sudo ln -s libonig.so.5 /lib/i386-linux-gnu/libonig.so - # Work around https://github.com/actions/runner-images/issues/9491 - sudo sysctl vm.mmap_rnd_bits=28 - name: Run tests run: | - make -j$(nproc) distcheck + .github/diag.sh make -j$(nproc) distcheck + + - uses: actions/upload-artifact@v4 + with: + name: linux-x86-config.log + path: distcheck-*/gen/config.log + + linux-arm: + name: Linux (Arm64) + runs-on: ubuntu-24.04-arm + + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update -y + sudo apt-get install -y \ + mandoc \ + acl \ + libacl1-dev \ + attr \ + libcap2-bin \ + libcap-dev \ + libonig-dev \ + liburing-dev + + - name: Run tests + run: | + .github/diag.sh make -j$(nproc) distcheck + + - uses: actions/upload-artifact@v4 + with: + name: linux-arm-config.log + path: distcheck-*/gen/config.log macos: name: macOS + runs-on: macos-15 - runs-on: macos-14 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name steps: - uses: actions/checkout@v4 - name: Install dependencies run: | - brew install \ - bash \ - expect + brew install bash - name: Run tests run: | jobs=$(sysctl -n hw.ncpu) - make -j$jobs distcheck + .github/diag.sh make -j$jobs distcheck freebsd: name: FreeBSD + runs-on: ubuntu-24.04 - runs-on: ubuntu-22.04 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name steps: - uses: actions/checkout@v4 - name: Run tests - uses: cross-platform-actions/action@v0.24.0 + uses: cross-platform-actions/action@v0.28.0 with: operating_system: freebsd - version: "14.0" - sync_files: runner-to-vm + version: "14.2" run: | sudo pkg install -y \ bash \ - expect \ oniguruma \ - pkgconf \ - tcl-wrapper + pkgconf sudo mount -t fdescfs none /dev/fd - make -j$(nproc) distcheck + .github/diag.sh make -j$(nproc) distcheck + + - uses: actions/upload-artifact@v4 + with: + name: freebsd-config.log + path: distcheck-*/gen/config.log openbsd: name: OpenBSD + runs-on: ubuntu-24.04 - runs-on: ubuntu-22.04 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name steps: - uses: actions/checkout@v4 - name: Run tests - uses: cross-platform-actions/action@v0.24.0 + uses: cross-platform-actions/action@v0.28.0 with: operating_system: openbsd - version: "7.5" - sync_files: runner-to-vm + version: "7.7" run: | sudo pkg_add \ bash \ - expect \ gmake \ oniguruma jobs=$(sysctl -n hw.ncpu) - gmake -j$jobs config - gmake -j$jobs check TEST_FLAGS="--sudo --verbose=skipped" + ./configure MAKE=gmake + .github/diag.sh gmake -j$jobs check TEST_FLAGS="--sudo --verbose=skipped" + + - uses: actions/upload-artifact@v4 + with: + name: openbsd-config.log + path: gen/config.log netbsd: name: NetBSD + runs-on: ubuntu-24.04 - runs-on: ubuntu-22.04 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name steps: - uses: actions/checkout@v4 - name: Run tests - uses: cross-platform-actions/action@v0.24.0 + uses: cross-platform-actions/action@v0.28.0 with: operating_system: netbsd - version: "10.0" - sync_files: runner-to-vm + version: "10.1" run: | PATH="/sbin:/usr/sbin:$PATH" sudo pkgin -y install \ bash \ oniguruma \ - pkgconf \ - tcl-expect + pkgconf jobs=$(sysctl -n hw.ncpu) - make -j$jobs config - make -j$jobs check TEST_FLAGS="--sudo --verbose=skipped" + ./configure + .github/diag.sh make -j$jobs check TEST_FLAGS="--sudo --verbose=skipped" + + - uses: actions/upload-artifact@v4 + with: + name: netbsd-config.log + path: gen/config.log dragonflybsd: name: DragonFly BSD + runs-on: ubuntu-24.04 - runs-on: ubuntu-22.04 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name steps: - uses: actions/checkout@v4 @@ -149,29 +196,32 @@ jobs: with: release: "6.4.0" usesh: true - copyback: false prepare: | pkg install -y \ bash \ - expect \ oniguruma \ pkgconf \ - sudo \ - tcl-wrapper + sudo pw useradd -n action -m -G wheel -s /usr/local/bin/bash echo "%wheel ALL=(ALL) NOPASSWD: ALL" >>/usr/local/etc/sudoers run: | chown -R action:action . jobs=$(sysctl -n hw.ncpu) - sudo -u action make config - sudo -u action make -j$jobs check TEST_FLAGS="--sudo --verbose=skipped" + sudo -u action ./configure + sudo -u action .github/diag.sh make -j$jobs check TEST_FLAGS="--sudo --verbose=skipped" + + - uses: actions/upload-artifact@v4 + with: + name: dragonfly-config.log + path: gen/config.log omnios: name: OmniOS + runs-on: ubuntu-24.04 - runs-on: ubuntu-22.04 + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name steps: - uses: actions/checkout@v4 @@ -179,15 +229,13 @@ jobs: - name: Run tests uses: vmactions/omnios-vm@v1 with: - release: "r151048" + release: "r151052" usesh: true - copyback: false prepare: | pkg install \ bash \ build-essential \ - expect \ gnu-make \ onig \ sudo @@ -198,5 +246,10 @@ jobs: PATH="/usr/xpg4/bin:$PATH" chown -R action:staff . jobs=$(getconf NPROCESSORS_ONLN) - sudo -u action gmake config - sudo -u action gmake -j$jobs check TEST_FLAGS="--sudo --verbose=skipped" + sudo -u action ./configure MAKE=gmake + sudo -u action .github/diag.sh gmake -j$jobs check TEST_FLAGS="--sudo --verbose=skipped" + + - uses: actions/upload-artifact@v4 + with: + name: omnios-config.log + path: gen/config.log diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 2245f40..e4e8f71 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -4,7 +4,7 @@ on: [push] jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -13,7 +13,6 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y \ - expect \ gcc \ acl \ libacl1-dev \ @@ -25,11 +24,11 @@ jobs: - name: Generate coverage run: | - make config GCOV=y + ./configure --enable-gcov make -j$(nproc) check TEST_FLAGS="--sudo" gcov -abcfpu obj/*/*.o - - uses: codecov/codecov-action@v4 + - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c21fda5..1f2041c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,7 +13,7 @@ on: jobs: analyze: name: Analyze - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: actions: read contents: read @@ -41,7 +41,7 @@ jobs: - name: Configure run: | - make -j$(nproc) config + ./configure - name: Initialize CodeQL uses: github/codeql-action/init@v3 |