From d2e47136572054bb14ea3d9fda7c3bbdb1787419 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Tue, 3 Jun 2025 01:29:47 +0300 Subject: [PATCH 1/7] fix: try to fix rate limit issue --- .github/workflows/build.yml | 1 + lib/utils.bash | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8e08e7..1e4cef7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,7 @@ jobs: asdf set ${{ matrix.tool.plugin }} ${{ matrix.version }} --home env: ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE: 1 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Run ${{ matrix.tool.plugin }} version check run: ${{ matrix.tool.command }} diff --git a/lib/utils.bash b/lib/utils.bash index 63ef335..cc716cb 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -36,8 +36,8 @@ log() { curl_opts=(-fsSL) # NOTE: You might want to remove this if clang-tools is not hosted on GitHub releases. -if [ -n "${GITHUB_API_TOKEN:-}" ]; then - curl_opts=("${curl_opts[@]}" -H "Authorization: token $GITHUB_API_TOKEN") +if [ -n "${GITHUB_TOKEN:-}" ]; then + curl_opts=("${curl_opts[@]}" -H "Authorization: token $GITHUB_TOKEN") fi sort_versions() { From fc409255c843c33c9a26bc75cc3558d38b098bda Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Tue, 3 Jun 2025 23:35:14 +0300 Subject: [PATCH 2/7] test: add sleep 10 for testing --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e4cef7..3ccb67b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,7 @@ jobs: - name: Install and set ${{ matrix.tool.plugin }} to ${{ matrix.version }} run: | + sleep 10 # Allow time for the plugin to be added asdf install ${{ matrix.tool.plugin }} ${{ matrix.version }} asdf set ${{ matrix.tool.plugin }} ${{ matrix.version }} --home env: From 715f612edc743506c09dd88a72e16a0c08e1d99d Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Wed, 4 Jun 2025 01:38:54 +0300 Subject: [PATCH 3/7] combine to one step --- .github/workflows/build.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ccb67b..eae7d0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,18 +24,12 @@ jobs: - name: Install asdf uses: asdf-vm/actions/setup@v4 - - name: Add plugin ${{ matrix.tool.plugin }} + - name: Test plugin ${{ matrix.tool.plugin }} on ${{ matrix.os }} with version ${{ matrix.version }} run: | asdf plugin add ${{ matrix.tool.plugin }} https://github.com/cpp-linter/asdf-clang-tools.git - - - name: Install and set ${{ matrix.tool.plugin }} to ${{ matrix.version }} - run: | - sleep 10 # Allow time for the plugin to be added asdf install ${{ matrix.tool.plugin }} ${{ matrix.version }} asdf set ${{ matrix.tool.plugin }} ${{ matrix.version }} --home + ${{ matrix.tool.command }} env: ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE: 1 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Run ${{ matrix.tool.plugin }} version check - run: ${{ matrix.tool.command }} From a574983a6d23d8c180bb9e160c7f7163876d3d2f Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Wed, 4 Jun 2025 01:44:49 +0300 Subject: [PATCH 4/7] only test v18 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eae7d0d..e7ac214 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: - { plugin: clang-query, command: "clang-query --version" } - { plugin: clang-tidy, command: "clang-tidy --version" } - { plugin: clang-apply-replacements, command: "clang-apply-replacements --version" } - version: ["18", "19", "20"] + version: ["18"] runs-on: ${{ matrix.os }} @@ -24,7 +24,7 @@ jobs: - name: Install asdf uses: asdf-vm/actions/setup@v4 - - name: Test plugin ${{ matrix.tool.plugin }} on ${{ matrix.os }} with version ${{ matrix.version }} + - name: Test plugin ${{ matrix.tool.plugin }} ${{ matrix.version }} on ${{ matrix.os }} run: | asdf plugin add ${{ matrix.tool.plugin }} https://github.com/cpp-linter/asdf-clang-tools.git asdf install ${{ matrix.tool.plugin }} ${{ matrix.version }} From 970c49e0087a242ed64d941a5d457fefbd3271d8 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Wed, 4 Jun 2025 01:46:12 +0300 Subject: [PATCH 5/7] add v19 for testing --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7ac214..31d0f5a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: - { plugin: clang-query, command: "clang-query --version" } - { plugin: clang-tidy, command: "clang-tidy --version" } - { plugin: clang-apply-replacements, command: "clang-apply-replacements --version" } - version: ["18"] + version: ["18", "19"] runs-on: ${{ matrix.os }} From 2f586be1262d4b77a81290cf090ae2188ea086f6 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Wed, 4 Jun 2025 01:51:15 +0300 Subject: [PATCH 6/7] refactor test workflow --- .github/workflows/build.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31d0f5a..f056a0a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,27 +8,35 @@ on: jobs: plugin_test: name: asdf plugin test + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-13] tool: - - { plugin: clang-format, command: "clang-format --version" } - - { plugin: clang-query, command: "clang-query --version" } - - { plugin: clang-tidy, command: "clang-tidy --version" } - - { plugin: clang-apply-replacements, command: "clang-apply-replacements --version" } + - plugin: clang-format + command: clang-format --version + - plugin: clang-query + command: clang-query --version + - plugin: clang-tidy + command: clang-tidy --version + - plugin: clang-apply-replacements + command: clang-apply-replacements --version version: ["18", "19"] - runs-on: ${{ matrix.os }} - steps: - name: Install asdf uses: asdf-vm/actions/setup@v4 - - name: Test plugin ${{ matrix.tool.plugin }} ${{ matrix.version }} on ${{ matrix.os }} + - name: Add plugin ${{ matrix.tool.plugin }} run: | asdf plugin add ${{ matrix.tool.plugin }} https://github.com/cpp-linter/asdf-clang-tools.git + + - name: Install and test ${{ matrix.tool.plugin }} ${{ matrix.version }} on ${{ matrix.os }} + run: | asdf install ${{ matrix.tool.plugin }} ${{ matrix.version }} - asdf set ${{ matrix.tool.plugin }} ${{ matrix.version }} --home + asdf set ${{ matrix.tool.plugin }} ${{ matrix.version }} + which ${{ matrix.tool.plugin }} ${{ matrix.tool.command }} env: ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE: 1 From 61be719b7f7900639e0000caf5be165ac4b99b89 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Wed, 4 Jun 2025 01:53:33 +0300 Subject: [PATCH 7/7] test more versions --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f056a0a..7c06842 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,8 @@ on: push: branches: [main] pull_request: + branches: [main] + workflow_dispatch: jobs: plugin_test: @@ -22,7 +24,7 @@ jobs: command: clang-tidy --version - plugin: clang-apply-replacements command: clang-apply-replacements --version - version: ["18", "19"] + version: ["8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"] steps: - name: Install asdf