Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider moving GITHUB_TOKEN into a job-level env: block under jobs.plugin_test so that it’s automatically available to all steps, reducing duplication.

Suggested change
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Copilot uses AI. Check for mistakes.
4 changes: 2 additions & 2 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down