From 64019783d10831457b960acc632d2f285da050ef Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Thu, 25 Jan 2024 20:29:06 +0100 Subject: [PATCH 01/11] MISC: Makefile.mk: fix missing CLEANDIRS Signed-off-by: Tim Janik --- misc/Makefile.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/misc/Makefile.mk b/misc/Makefile.mk index f4d794f2..98ed3431 100644 --- a/misc/Makefile.mk +++ b/misc/Makefile.mk @@ -49,9 +49,8 @@ $>/clang-tidy/%.log: % $(GITCOMMITDEPS) | $>/clang-tidy/ CLANG_TIDY_DEFS := -I. -I$> -isystem external/ -isystem $>/external/ -DASE_COMPILATION $(ASEDEPS_CFLAGS) $(GTK2_CFLAGS) # File specific LINT_FLAGS, example: ase/jsonapi.cc.LINT_FLAGS ::= --checks=-clang-analyzer-core.NullDereference jsonipc/testjsonipc.cc.CTIDY_DEFS ::= -D__JSONIPC_NULL_REFERENCE_THROWS__ -clang-tidy-clean: - rm -f -r $>/clang-tidy/ .PHONY: clang-tid clang-tidy-clean +CLEANDIRS += $>/clang-tidy/ # == scan-build == scan-build: | $>/misc/scan-build/ From 53b6aeaf058be7394ce1986638556189f74a675f Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Thu, 25 Jan 2024 20:25:37 +0100 Subject: [PATCH 02/11] MISC: mknews.sh: show git command line Signed-off-by: Tim Janik --- misc/mknews.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/mknews.sh b/misc/mknews.sh index 75b32880..bdb19567 100755 --- a/misc/mknews.sh +++ b/misc/mknews.sh @@ -56,3 +56,5 @@ else echo '``````````````````````````````````````````````````````````````````````````````````````' echo fi + +echo "git log --first-parent --date=short --pretty=\"%s # %cd %an %h%n%w(0,4,4)%b\" '$NEWS_TAG..HEAD' | sed -r 's/\s+[A-Z][a-zA-Z0-9-]*:.*<.*@.*>\s*$//' " >&2 From 538fddcb5b2c3c34d62566cc3daf51864fcd9523 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Tue, 23 Jan 2024 23:03:59 +0100 Subject: [PATCH 03/11] GITHUB: workflows/testing.yml: disable CI on tag pushes Signed-off-by: Tim Janik --- .github/workflows/testing.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index b34d193b..7e4b67d6 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -5,9 +5,9 @@ on: push: branches: [ 'trunk', 'next', 'wip/**' ] - tags: [ 'v[0-9]+.[0-9]+.[0-9]+*' ] + # tags: [ 'v[0-9]+.[0-9]+.[0-9]+*' ] pull_request: - branches: ['trunk', 'next'] + branches: [ 'trunk', 'next' ] jobs: @@ -56,9 +56,7 @@ jobs: # Artifact upload from x11test - uses: actions/upload-artifact@v3.1.3 if: always() - with: - name: x11test - path: out/x11test/ + with: { name: "x11test", path: "out/x11test/" } Focal-Clang-Tidy: if: ${{ ! contains(github.ref, 'refs/tags/') }} From 236cd0bec42465f38f6f5ec7eb8bc2028e482792 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Thu, 25 Jan 2024 01:53:16 +0100 Subject: [PATCH 04/11] MISC: Makefile.mk: add branch-check rule, $BRANCH_CHECK_EXIT holds error status Signed-off-by: Tim Janik --- misc/Makefile.mk | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/misc/Makefile.mk b/misc/Makefile.mk index 98ed3431..897895c7 100644 --- a/misc/Makefile.mk +++ b/misc/Makefile.mk @@ -70,6 +70,24 @@ scan-build: | $>/misc/scan-build/ .PHONY: scan-build # Note, 'make scan-build' requires 'make default CC=clang CXX=clang++' to generate any reports. +# == branch-check == +# Check for various lint results in files touched by the current branch +BRANCH_CHECK_UPSTREAM ::= trunk +branch-check: + $(QGEN) + $Q script -O $>/$(@F).log $>/$(@F).files && sed 's/$$/:/' -i $>/$(@F).files + $Q grep -qFf $>/$(@F).files $>/$(@F).log || exit 0 \ + && M="$@: $$(git describe --all --always HEAD): Problems found in files touched since '$(BRANCH_CHECK_UPSTREAM)'" \ + && echo && echo "$$M" | sed -e '1{ h; s/./=/g; p;x; p;x; }' + $Q (set -x && grep -m 24 --color=auto -Ff $>/$(@F).files $>/$(@F).log) || exit 0 && exit $(BRANCH_CHECK_EXIT) +BRANCH_CHECK_EXIT ?= 0 +.PHONY: branch-check + # == misc/anklang.desktop == # https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html $>/misc/anklang.desktop: misc/anklang.desktop | $>/misc/ From f42852fac0f928483ccd7becd1a30f61f57753f2 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Fri, 26 Jan 2024 00:42:31 +0100 Subject: [PATCH 05/11] GITHUB: workflows/testing.yml: add `make branch-check` and check errors in PRs Signed-off-by: Tim Janik --- .github/workflows/testing.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 7e4b67d6..d6f91f86 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -80,6 +80,11 @@ jobs: # Artifact upload from clang-tidy - uses: actions/upload-artifact@v3.1.3 with: { name: clang-tidy, path: out/clang-tidy/ } + - name: 'Make branch-check' + # Use non-0 exit status for a failing branch-check on PRs + run: | + test -z "${{ github.event.pull_request }}" || BRANCH_CHECK_EXIT=77 + misc/cirun -u 1000 make branch-check BRANCH_CHECK_EXIT=$BRANCH_CHECK_EXIT Release-Upload: needs: [Focal-Assets, Arch-Replay] From 849aae5e90e786a1ec26e82d2ac365dffe5a76c5 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Fri, 26 Jan 2024 01:17:21 +0100 Subject: [PATCH 06/11] MISC: Makefile.mk: fix script v2.34 invocation The util script from util-linux 2.34 (focal) has no `-O` option. Signed-off-by: Tim Janik --- misc/Makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/Makefile.mk b/misc/Makefile.mk index 897895c7..d9c3002c 100644 --- a/misc/Makefile.mk +++ b/misc/Makefile.mk @@ -75,7 +75,7 @@ scan-build: | $>/misc/scan-build/ BRANCH_CHECK_UPSTREAM ::= trunk branch-check: $(QGEN) - $Q script -O $>/$(@F).log /$(@F).log Date: Fri, 26 Jan 2024 01:20:10 +0100 Subject: [PATCH 07/11] GITHUB: workflows/testing.yml: remove Release-Upload run Signed-off-by: Tim Janik --- .github/workflows/testing.yml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index d6f91f86..0a0d1af6 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -86,32 +86,18 @@ jobs: test -z "${{ github.event.pull_request }}" || BRANCH_CHECK_EXIT=77 misc/cirun -u 1000 make branch-check BRANCH_CHECK_EXIT=$BRANCH_CHECK_EXIT - Release-Upload: - needs: [Focal-Assets, Arch-Replay] - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - env: { GH_TOKEN: "${{ github.token }}" } - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Download Release Assets - uses: actions/download-artifact@v3 - - run: ls -lR assets/ - - name: Create Release with Assets - run: misc/publish.sh - Ping-IRC: if: always() - needs: [Focal-Assets, Arch-Replay, Focal-Clang-Tidy, Release-Upload] + needs: [Focal-Assets, Arch-Replay, Focal-Clang-Tidy] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Check Jobs run: | - echo '${{ needs.Focal-Assets.result }}' '${{ needs.Arch-Replay.result }}' '${{ needs.Focal-Clang-Tidy.result }}' '${{ needs.Release-Upload.result }}' + echo '${{ needs.Focal-Assets.result }}' '${{ needs.Arch-Replay.result }}' '${{ needs.Focal-Clang-Tidy.result }}' [[ ${{ needs.Focal-Assets.result }} =~ success|skipped ]] [[ ${{ needs.Arch-Replay.result }} =~ success|skipped ]] [[ ${{ needs.Focal-Clang-Tidy.result }} =~ success|skipped ]] - [[ ${{ needs.Release-Upload.result }} =~ success|skipped ]] - name: Ping IRC if: always() run: | From 14916a702f22d39c7c514645b04fd97f93dd4853 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Fri, 26 Jan 2024 01:46:17 +0100 Subject: [PATCH 08/11] GITHUB: workflows/testing.yml: use actions/checkout@v4.1.1, fix annotated tag Upgrade to actions/checkout@v4.1.1 and Fix actions/checkout messing up checkouts of annotated tags; actions/checkout#290 Also fetch submodule upfront. Signed-off-by: Tim Janik --- .github/workflows/testing.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0a0d1af6..e44bafed 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -15,7 +15,11 @@ jobs: runs-on: ubuntu-latest env: { CICACHE: "/tmp/cicache", CITAG: "focal" } steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.1.1 + with: { fetch-depth: 0 } + - run: | + git fetch -f --tags # Fix actions/checkout annotated tag mess; actions/checkout#290 + git submodule update --init --recursive - uses: actions/cache@v3 with: { path: "/tmp/cicache", key: "cifocal-${{hashFiles ('misc/Dockerfile.focal')}}" } - name: 'Prepare Docker Image' @@ -40,7 +44,11 @@ jobs: runs-on: ubuntu-latest env: { CICACHE: "/tmp/cicache", CITAG: "arch" } steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.1.1 + with: { fetch-depth: 0 } + - run: | + git fetch -f --tags # Fix actions/checkout annotated tag mess; actions/checkout#290 + git submodule update --init --recursive - uses: actions/cache@v3 with: { path: "/tmp/cicache", key: "ciarch-${{hashFiles ('misc/Dockerfile.arch')}}" } - name: 'Prepare Docker Image' @@ -63,7 +71,11 @@ jobs: runs-on: ubuntu-latest env: { CICACHE: "/tmp/cicache", CITAG: "focal" } steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.1.1 + with: { fetch-depth: 0 } + - run: | + git fetch -f --tags # Fix actions/checkout annotated tag mess; actions/checkout#290 + git submodule update --init --recursive - uses: actions/cache@v3 with: { path: "/tmp/cicache", key: "cifocal-${{hashFiles ('misc/Dockerfile.focal')}}" } - name: 'Prepare Docker Image' @@ -91,7 +103,11 @@ jobs: needs: [Focal-Assets, Arch-Replay, Focal-Clang-Tidy] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4.1.1 + with: { fetch-depth: 0 } + - run: | + git fetch -f --tags # Fix actions/checkout annotated tag mess; actions/checkout#290 + git submodule update --init --recursive - name: Check Jobs run: | echo '${{ needs.Focal-Assets.result }}' '${{ needs.Arch-Replay.result }}' '${{ needs.Focal-Clang-Tidy.result }}' From 6aacf614583a3ae8a0a23165c20d85052a4ad116 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Fri, 26 Jan 2024 02:19:28 +0100 Subject: [PATCH 09/11] GITHUB: workflows/testing.yml: update to actions/cache@v4 Signed-off-by: Tim Janik --- .github/workflows/testing.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index e44bafed..205c0de9 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -20,7 +20,7 @@ jobs: - run: | git fetch -f --tags # Fix actions/checkout annotated tag mess; actions/checkout#290 git submodule update --init --recursive - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: { path: "/tmp/cicache", key: "cifocal-${{hashFiles ('misc/Dockerfile.focal')}}" } - name: 'Prepare Docker Image' run: | @@ -49,7 +49,7 @@ jobs: - run: | git fetch -f --tags # Fix actions/checkout annotated tag mess; actions/checkout#290 git submodule update --init --recursive - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: { path: "/tmp/cicache", key: "ciarch-${{hashFiles ('misc/Dockerfile.arch')}}" } - name: 'Prepare Docker Image' run: | @@ -76,7 +76,7 @@ jobs: - run: | git fetch -f --tags # Fix actions/checkout annotated tag mess; actions/checkout#290 git submodule update --init --recursive - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: { path: "/tmp/cicache", key: "cifocal-${{hashFiles ('misc/Dockerfile.focal')}}" } - name: 'Prepare Docker Image' run: | From 42d8ebf409ba5f48ed7c12d5a91b3510a7ca45eb Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Fri, 26 Jan 2024 03:10:18 +0100 Subject: [PATCH 10/11] GITHUB: workflows/testing.yml: only build & upload docs from tim-janik/anklang Signed-off-by: Tim Janik --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 205c0de9..fa4655e7 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -34,7 +34,7 @@ jobs: - uses: actions/upload-artifact@v3.1.3 with: { name: dist-tarball, path: assets/*.tar* } - name: 'Upload API Docs' # http://tim-janik.github.io/docs/anklang - if: github.ref == 'refs/heads/trunk' + if: github.repository == 'tim-janik/anklang' && github.ref == 'refs/heads/trunk' run: | misc/cirun -u 1000 make -j`nproc` all (umask 0077 && cat <<< "${{ secrets.SSH_ID_GHDOCS4ANKLANG_ECDSA }}" > .git/.ssh_id_ghdocs4anklang) From b8dc4a949711dd3a0ae0323b069c047161d7a38b Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Fri, 26 Jan 2024 02:24:09 +0100 Subject: [PATCH 11/11] GITHUB: workflows/testing.yml: update to actions/upload-artifact@v4 Signed-off-by: Tim Janik --- .github/workflows/testing.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index fa4655e7..b7be5a0c 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -29,9 +29,9 @@ jobs: - name: 'Build Dist Assets' run: | misc/cirun -u 1000 make mkassets - - uses: actions/upload-artifact@v3.1.3 + - uses: actions/upload-artifact@v4 with: { name: assets, path: assets/ } - - uses: actions/upload-artifact@v3.1.3 + - uses: actions/upload-artifact@v4 with: { name: dist-tarball, path: assets/*.tar* } - name: 'Upload API Docs' # http://tim-janik.github.io/docs/anklang if: github.repository == 'tim-janik/anklang' && github.ref == 'refs/heads/trunk' @@ -62,7 +62,7 @@ jobs: misc/cirun -u 1000 make -j`nproc` check misc/cirun -u 1000 make x11test-v # Artifact upload from x11test - - uses: actions/upload-artifact@v3.1.3 + - uses: actions/upload-artifact@v4 if: always() with: { name: "x11test", path: "out/x11test/" } @@ -90,7 +90,7 @@ jobs: run: | misc/cirun -u 1000 make -j`nproc` clang-tidy # Artifact upload from clang-tidy - - uses: actions/upload-artifact@v3.1.3 + - uses: actions/upload-artifact@v4 with: { name: clang-tidy, path: out/clang-tidy/ } - name: 'Make branch-check' # Use non-0 exit status for a failing branch-check on PRs