From 942d48af3c14c82fd334331a2e190d9aa93fe692 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 30 Aug 2024 09:48:01 -0400 Subject: [PATCH 1/2] Replace custom clang-format bits with stock meson targets This is built into meson: https://mesonbuild.com/Code-formatting.html Signed-off-by: Colin Walters --- .../.clang-format => .clang-format | 0 .clang-format-ignore | 4 +++ .clang-format-include | 2 ++ .github/workflows/test.yaml | 27 ++++++++++--------- hacking/clang-format/Dockerfile | 8 ------ hacking/clang-format/Makefile | 7 ----- hacking/clang-format/run-tests.sh | 12 --------- 7 files changed, 20 insertions(+), 40 deletions(-) rename hacking/clang-format/.clang-format => .clang-format (100%) create mode 100644 .clang-format-ignore create mode 100644 .clang-format-include delete mode 100644 hacking/clang-format/Dockerfile delete mode 100644 hacking/clang-format/Makefile delete mode 100755 hacking/clang-format/run-tests.sh diff --git a/hacking/clang-format/.clang-format b/.clang-format similarity index 100% rename from hacking/clang-format/.clang-format rename to .clang-format diff --git a/.clang-format-ignore b/.clang-format-ignore new file mode 100644 index 00000000..3dc1c74f --- /dev/null +++ b/.clang-format-ignore @@ -0,0 +1,4 @@ +*bitrotate* +*hash* +*xalloc-oversized* +*erofs_fs* diff --git a/.clang-format-include b/.clang-format-include new file mode 100644 index 00000000..e20fdf57 --- /dev/null +++ b/.clang-format-include @@ -0,0 +1,2 @@ +libcomposefs/**/* +tools/**/* diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 19d0260e..a6b569a9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,6 +6,20 @@ permissions: actions: read jobs: + clang-format: + # To pick up a newer clang + runs-on: ubuntu-24.04 + name: "clang-format" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install dependencies + run: sudo ./hacking/installdeps.sh + - name: Configure + run: meson setup build --prefix=/usr + - name: clang-format + run: ninja -C build clang-format-check + # This build doesn't enable ASAN, which e.g. makes it easier to use with Rust build: runs-on: ubuntu-latest name: "Build with ASAN" @@ -148,19 +162,6 @@ jobs: run: cargo test - name: Rust (all features) run: cargo test -F v1_0_4 - clang-format: - runs-on: ubuntu-24.04 - steps: - - name: checkout - uses: actions/checkout@v2 - - name: install dependencies - run: | - sudo apt-get update -y - sudo apt-get install -y make clang-format - - name: check formatting - run: | - sudo docker build -t clang-format hacking/clang-format - sudo docker run --rm -w /src -v ${PWD}:/src clang-format distcheck: runs-on: ubuntu-latest steps: diff --git a/hacking/clang-format/Dockerfile b/hacking/clang-format/Dockerfile deleted file mode 100644 index 33bd6e49..00000000 --- a/hacking/clang-format/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM fedora:latest - -RUN dnf install -y git make clang-tools-extra - -WORKDIR /src - -COPY run-tests.sh /usr/local/bin -ENTRYPOINT /usr/local/bin/run-tests.sh diff --git a/hacking/clang-format/Makefile b/hacking/clang-format/Makefile deleted file mode 100644 index 6b2c58c7..00000000 --- a/hacking/clang-format/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: - -clang-format: - # do not format files that were copied into the source directory. - git ls-files ../../libcomposefs ../../tools | grep -Ee "\\.[hc]" | grep -v "bitrotate\|hash\|xalloc-oversized\|erofs_fs" | xargs clang-format -style=file -i - -.PHONY: clang-format diff --git a/hacking/clang-format/run-tests.sh b/hacking/clang-format/run-tests.sh deleted file mode 100755 index 81435202..00000000 --- a/hacking/clang-format/run-tests.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -e -x - -cd /src - -# Recent git complains that the directory is owned by someone else, -# which happens if we run it via a Dockefile with a volume mounted. -git config --global --add safe.directory "$(pwd)" - -make -C hacking/clang-format clang-format -git diff --ignore-submodules --exit-code From 6fb712f3208bc2777cd61b1b7b554f59c293c7af Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 30 Aug 2024 11:08:12 -0400 Subject: [PATCH 2/2] ci: Upload test logs in more build jobs Signed-off-by: Colin Walters --- .github/workflows/test.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a6b569a9..d8af6d2d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -45,6 +45,12 @@ jobs: with: name: composefs.tar path: composefs.tar + - name: Upload log + uses: actions/upload-artifact@v4 + if: always() + with: + name: testlog-asan.txt + path: build/meson-logs/testlog.txt # This build doesn't enable ASAN, which e.g. makes it easier to use with Rust build-noasan: runs-on: ubuntu-latest @@ -65,6 +71,12 @@ jobs: with: name: composefs-noasan.tar path: composefs.tar + - name: Upload log + uses: actions/upload-artifact@v4 + if: always() + with: + name: testlog-noasan.txt + path: build/meson-logs/testlog.txt build-baseline: runs-on: ubuntu-latest name: "Build on Ubuntu Focal"