Skip to content

Commit c25b4d8

Browse files
authored
fix: plugin test failure and change to GITHUB_TOKEN (#8)
* fix: try to fix rate limit issue * test: add sleep 10 for testing * combine to one step * only test v18 * add v19 for testing * refactor test workflow * test more versions
1 parent cf24024 commit c25b4d8

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,27 @@ on:
44
push:
55
branches: [main]
66
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
79

810
jobs:
911
plugin_test:
1012
name: asdf plugin test
13+
runs-on: ${{ matrix.os }}
1114
strategy:
15+
fail-fast: false
1216
matrix:
1317
os: [ubuntu-latest, macos-13]
1418
tool:
15-
- { plugin: clang-format, command: "clang-format --version" }
16-
- { plugin: clang-query, command: "clang-query --version" }
17-
- { plugin: clang-tidy, command: "clang-tidy --version" }
18-
- { plugin: clang-apply-replacements, command: "clang-apply-replacements --version" }
19-
version: ["18", "19", "20"]
20-
21-
runs-on: ${{ matrix.os }}
19+
- plugin: clang-format
20+
command: clang-format --version
21+
- plugin: clang-query
22+
command: clang-query --version
23+
- plugin: clang-tidy
24+
command: clang-tidy --version
25+
- plugin: clang-apply-replacements
26+
command: clang-apply-replacements --version
27+
version: ["8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"]
2228

2329
steps:
2430
- name: Install asdf
@@ -28,12 +34,12 @@ jobs:
2834
run: |
2935
asdf plugin add ${{ matrix.tool.plugin }} https://github.com/cpp-linter/asdf-clang-tools.git
3036
31-
- name: Install and set ${{ matrix.tool.plugin }} to ${{ matrix.version }}
37+
- name: Install and test ${{ matrix.tool.plugin }} ${{ matrix.version }} on ${{ matrix.os }}
3238
run: |
3339
asdf install ${{ matrix.tool.plugin }} ${{ matrix.version }}
34-
asdf set ${{ matrix.tool.plugin }} ${{ matrix.version }} --home
40+
asdf set ${{ matrix.tool.plugin }} ${{ matrix.version }}
41+
which ${{ matrix.tool.plugin }}
42+
${{ matrix.tool.command }}
3543
env:
3644
ASDF_CLANG_TOOLS_MACOS_DEQUARANTINE: 1
37-
38-
- name: Run ${{ matrix.tool.plugin }} version check
39-
run: ${{ matrix.tool.command }}
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

lib/utils.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ log() {
3636
curl_opts=(-fsSL)
3737

3838
# NOTE: You might want to remove this if clang-tools is not hosted on GitHub releases.
39-
if [ -n "${GITHUB_API_TOKEN:-}" ]; then
40-
curl_opts=("${curl_opts[@]}" -H "Authorization: token $GITHUB_API_TOKEN")
39+
if [ -n "${GITHUB_TOKEN:-}" ]; then
40+
curl_opts=("${curl_opts[@]}" -H "Authorization: token $GITHUB_TOKEN")
4141
fi
4242

4343
sort_versions() {

0 commit comments

Comments
 (0)