| name: Build test | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - 'Documentation/**' | |
| - 'lib*/docs/**' | |
| push: | |
| branches: | |
| - 'cibuild' | |
| - 'master' | |
| - 'next' | |
| - 'stable/**' | |
| paths-ignore: | |
| - 'Documentation/**' | |
| - 'lib*/docs/**' | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ toJSON(matrix.env) }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| env: | |
| - { COMPILER: "gcc", COMPILER_VERSION: "15", SANITIZE: "yes" } | |
| - { COMPILER: "gcc", COMPILER_VERSION: "15", SANITIZE: "no" } | |
| - { COMPILER: "clang", COMPILER_VERSION: "23", SANITIZE: "yes" } | |
| - { COMPILER: "clang", COMPILER_VERSION: "23", SANITIZE: "no" } | |
| env: ${{ matrix.env }} | |
| steps: | |
| - name: Repository checkout | |
| uses: actions/checkout@v7 | |
| - name: Ubuntu setup | |
| run: | | |
| sudo --preserve-env=COMPILER,COMPILER_VERSION,SANITIZE \ | |
| .github/workflows/cibuild-setup-ubuntu.sh | |
| - name: Configure | |
| run: .github/workflows/cibuild.sh CONFIGUREFAST | |
| - name: Code checks | |
| run: .github/workflows/cibuild.sh CODECHECK | |
| - name: Configure & Make | |
| run: .github/workflows/cibuild.sh MAKE | |
| - name: Check | |
| run: | | |
| sudo --preserve-env=COMPILER,COMPILER_VERSION,SANITIZE \ | |
| .github/workflows/cibuild.sh CHECK | |
| - name: Make install | |
| run: .github/workflows/cibuild.sh INSTALL | |
| coveralls: | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| checks: write # to create new checks (coverallsapp/github-action) | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'util-linux/util-linux' | |
| concurrency: | |
| group: ${{ github.workflow }}-coveralls-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| COMPILER: gcc | |
| COMPILER_VERSION: 15 | |
| SANITIZE: no | |
| COVERAGE: yes | |
| steps: | |
| - name: Repository checkout | |
| uses: actions/checkout@v7 | |
| - name: Ubuntu setup | |
| run: | | |
| sudo --preserve-env=COMPILER,COMPILER_VERSION,SANITIZE,COVERAGE \ | |
| .github/workflows/cibuild-setup-ubuntu.sh | |
| - name: Configure & Make | |
| run: .github/workflows/cibuild.sh CONFIGUREFAST MAKE | |
| - name: Check | |
| run: | | |
| sudo --preserve-env=COMPILER,COMPILER_VERSION,SANITIZE,COVERAGE \ | |
| .github/workflows/cibuild.sh CHECK | |
| - name: Coveralls | |
| uses: coverallsapp/github-action@master | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| path-to-lcov: ./coverage.info | |
| meson: | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-meson-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| COMPILER: gcc | |
| COMPILER_VERSION: 15 | |
| SANITIZE: no | |
| steps: | |
| - name: Repository checkout | |
| uses: actions/checkout@v7 | |
| - name: Ubuntu setup | |
| run: | | |
| sudo --preserve-env=COMPILER,COMPILER_VERSION,SANITIZE \ | |
| .github/workflows/cibuild-setup-ubuntu.sh | |
| - name: Meson configure | |
| run: .github/workflows/cibuild.sh MESONCONF | |
| - name: Meson build | |
| run: .github/workflows/cibuild.sh MESONBUILD | |
| - name: Check | |
| run: .github/workflows/cibuild.sh CHECK | |
| distcheck: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-distcheck-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| COMPILER: gcc | |
| COMPILER_VERSION: 15 | |
| SANITIZE: no | |
| TRANSLATE_MANPAGES: yes | |
| steps: | |
| - name: Repository checkout | |
| uses: actions/checkout@v7 | |
| - name: Ubuntu setup | |
| run: | | |
| sudo --preserve-env=COMPILER,COMPILER_VERSION,SANITIZE,TRANSLATE_MANPAGES \ | |
| .github/workflows/cibuild-setup-ubuntu.sh | |
| - name: Configure | |
| run: .github/workflows/cibuild.sh CONFIGURE | |
| - name: Make distcheck | |
| run: .github/workflows/cibuild.sh DISTCHECK | |
| build-compat: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - image: ubuntu:18.04 | |
| name: build (compat, ${{ matrix.image }}) | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-build-compat-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| COMPILER: none | |
| container: | |
| image: ${{ matrix.image }} | |
| steps: | |
| - name: Repository checkout | |
| uses: actions/checkout@v1 | |
| - name: Ubuntu setup | |
| run: .github/workflows/cibuild-setup-ubuntu.sh | |
| - name: Configure | |
| run: .github/workflows/cibuild.sh CONFIGUREFAST | |
| - name: Code checks | |
| run: .github/workflows/cibuild.sh CODECHECK | |
| - name: Configure & Make | |
| run: .github/workflows/cibuild.sh MAKE | |
| - name: Check | |
| run: .github/workflows/cibuild.sh CHECK | |
| build-arch: | |
| name: build (qemu-user, ${{ matrix.arch }}) | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ toJSON(matrix) }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: s390x | |
| - arch: riscv64 | |
| - arch: armv7 | |
| steps: | |
| - name: Repository checkout | |
| uses: actions/checkout@v7 | |
| - uses: uraimo/run-on-arch-action@v3 | |
| with: | |
| arch: ${{ matrix.arch }} | |
| dockerRunArgs: --privileged -v /dev:/dev | |
| distro: ubuntu_latest | |
| run: | | |
| export COMPILER=gcc | |
| export COMPILER_VERSION=15 | |
| export SANITIZE=no | |
| export QEMU_USER=1 | |
| # name: Ubuntu setup | |
| .github/workflows/cibuild-setup-ubuntu.sh | |
| git config --global --add safe.directory "$PWD" | |
| # Configure & Make | |
| .github/workflows/cibuild.sh CONFIGUREFAST MAKE | |
| # Check | |
| .github/workflows/cibuild.sh CHECK | |
| build-openwrt: | |
| name: build (openwrt, ${{ matrix.target }}/${{ matrix.subtarget}}) | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ toJSON(matrix) }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: ipq40xx | |
| subtarget: generic | |
| abi: musl_eabi | |
| - target: ath79 | |
| subtarget: generic | |
| abi: musl | |
| - target: loongarch64 | |
| subtarget: generic | |
| abi: musl | |
| - target: mpc85xx | |
| subtarget: p2020 | |
| abi: musl | |
| - target: x86 | |
| subtarget: generic | |
| abi: musl | |
| - target: octeon | |
| subtarget: generic | |
| abi: musl | |
| - target: ramips | |
| subtarget: mt7620 | |
| abi: musl | |
| env: | |
| COMPILER: none | |
| steps: | |
| - name: Repository checkout | |
| uses: actions/checkout@v7 | |
| - name: Ubuntu setup | |
| run: sudo --preserve-env=COMPILER .github/workflows/cibuild-setup-ubuntu.sh | |
| - name: OpenWrt environment | |
| run: | | |
| OPENWRT_RELEASE=25.12.2 | |
| OPENWRT_SDK=openwrt-sdk-$OPENWRT_RELEASE-${{ matrix.target }}-${{ matrix.subtarget }}_gcc-14.3.0_${{ matrix.abi }}.Linux-x86_64 | |
| echo "COMPILER=$COMPILER" >> $GITHUB_ENV | |
| echo "OPENWRT_RELEASE=$OPENWRT_RELEASE" >> $GITHUB_ENV | |
| echo "OPENWRT_SDK=$OPENWRT_SDK" >> $GITHUB_ENV | |
| echo "OPENWRT_TARGET=${{ matrix.target }}" >> $GITHUB_ENV | |
| - name: Cache OpenWRT SDK | |
| id: cache-openwrt-sdk | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/${{ env.OPENWRT_SDK }} | |
| key: ${{ env.OPENWRT_SDK }} | |
| - name: Download toolchain | |
| if: steps.cache-openwrt-sdk.outputs.cache-hit != 'true' | |
| run: | | |
| curl -o ~/${{ env.OPENWRT_SDK }}.tar.zst -C - https://downloads.cdn.openwrt.org/releases/${{ env.OPENWRT_RELEASE }}/targets/${{ matrix.target }}/${{ matrix.subtarget }}/${{ env.OPENWRT_SDK }}.tar.zst | |
| tar xf ~/${{ env.OPENWRT_SDK }}.tar.zst -C ~ | |
| - name: Configure | |
| run: | | |
| source .github/workflows/openwrt-sdk-env.sh ~/${{ env.OPENWRT_SDK }} | |
| .github/workflows/cibuild.sh CONFIGUREFAST | |
| - name: Make | |
| run: | | |
| source .github/workflows/openwrt-sdk-env.sh ~/${{ env.OPENWRT_SDK }} | |
| .github/workflows/cibuild.sh MAKE | |
| - name: Check | |
| run: | | |
| source .github/workflows/openwrt-sdk-env.sh ~/${{ env.OPENWRT_SDK }} | |
| if [[ "$OPENWRT_TARGET" = "x86" ]]; then | |
| .github/workflows/cibuild.sh CHECK | |
| fi | |
| build-macos: | |
| name: build macos | |
| runs-on: macos-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-macos-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| COMPILER: none | |
| HOMEBREWPATH: "/opt/homebrew/bin:/opt/homebrew/opt/bison/bin:/opt/homebrew/opt/coreutils/libexec/gnubin:/opt/homebrew/opt/findutils/libexec/gnubin:/opt/homebrew/opt/gnu-sed/libexec/gnubin" | |
| steps: | |
| - name: Prepare | |
| run: | | |
| brew install meson coreutils bison findutils gnu-sed bash | |
| - name: Repository checkout | |
| uses: actions/checkout@v7 | |
| - name: Configure | |
| run: | | |
| PATH="$HOMEBREWPATH:$PATH" | |
| .github/workflows/cibuild.sh MESONCONF | |
| - name: Make | |
| run: | | |
| PATH="$HOMEBREWPATH:$PATH" | |
| .github/workflows/cibuild.sh MESONBUILD | |
| - name: Check | |
| run: | | |
| PATH="$HOMEBREWPATH:$PATH" | |
| .github/workflows/cibuild.sh CHECK |