diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8e08e7..7c06842 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,21 +4,27 @@ on: push: branches: [main] pull_request: + branches: [main] + workflow_dispatch: 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" } - version: ["18", "19", "20"] - - runs-on: ${{ matrix.os }} + - 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: ["8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"] steps: - name: Install asdf @@ -28,12 +34,12 @@ jobs: 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 }} + - 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 - - - name: Run ${{ matrix.tool.plugin }} version check - run: ${{ matrix.tool.command }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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() {