diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 39ce891..f22e4bb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -146,3 +146,107 @@ jobs: echo "Expected symlink target '$EXPECTED', got '$LINK'" exit 1 fi + + test-only-tools-skips-skills: + name: only_tools=true installs tools but skips skills + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + # Write a Lucafile that defines both a tool and a skill. + - name: Create fixture Lucafile + run: | + cat > Lucafile <<'EOF' + --- + tools: + - name: yq + desiredBinaryName: yq + version: 4.52.4 + url: https://github.com/mikefarah/yq/releases/download/v4.52.4/yq_darwin_arm64 + + agents: + - claude-code + + skills: + - name: swift-concurrency + repository: AvdLee/Swift-Concurrency-Agent-Skill + version: 2.1.1 + + EOF + + # only_tools defaults to "true", so --only-tools is passed to `luca install`. + - name: Setup Luca (only_tools default) + uses: ./ + with: + spec: Lucafile + + - name: Verify the tool was installed + run: | + YQ_VERSION=$(yq --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) + if [ "$YQ_VERSION" != "4.52.4" ]; then + echo "Expected yq 4.52.4, got $YQ_VERSION" + exit 1 + fi + + - name: Verify the skill was NOT installed + run: | + if [ -e .luca/skills/swift-concurrency ]; then + echo ".luca/skills/swift-concurrency should not exist when only_tools=true" + exit 1 + fi + if [ -e .claude/skills/swift-concurrency ]; then + echo ".claude/skills/swift-concurrency should not exist when only_tools=true" + exit 1 + fi + + test-only-tools-false-installs-skills: + name: only_tools=false installs both tools and skills + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + # Write a Lucafile that defines both a tool and a skill. + - name: Create fixture Lucafile + run: | + cat > Lucafile <<'EOF' + --- + tools: + - name: yq + desiredBinaryName: yq + version: 4.52.4 + url: https://github.com/mikefarah/yq/releases/download/v4.52.4/yq_darwin_arm64 + + agents: + - claude-code + + skills: + - name: swift-concurrency + repository: AvdLee/Swift-Concurrency-Agent-Skill + version: 2.1.1 + + EOF + + - name: "Setup Luca (only_tools: false)" + uses: ./ + with: + spec: Lucafile + only_tools: "false" + + - name: Verify the tool was installed + run: | + YQ_VERSION=$(yq --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) + if [ "$YQ_VERSION" != "4.52.4" ]; then + echo "Expected yq 4.52.4, got $YQ_VERSION" + exit 1 + fi + + - name: Verify the skill was installed + run: | + if [ ! -e .luca/skills/swift-concurrency ]; then + echo "Expected .luca/skills/swift-concurrency to exist" + exit 1 + fi + if [ ! -e .claude/skills/swift-concurrency ]; then + echo "Expected .claude/skills/swift-concurrency to exist" + exit 1 + fi diff --git a/README.md b/README.md index 8d40e9f..93a070a 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ On GitHub Enterprise the built-in `github.token` is scoped to your enterprise in |-------|-------------|----------|---------| | `version` | Luca version to install (e.g. `"1.2.3"`). Omit to use the latest release. | No | `""` (latest) | | `spec` | Path to the Luca spec file, relative to the workspace root. Omit to skip tool installation. | No | `""` (skip) | +| `only_tools` | When `true`, passes `--only-tools` to `luca install`, installing tools only. Set to `false` to also install skills defined in the spec file. | No | `true` | | `github_token` | GitHub token for authenticating against the github.com API when downloading the Luca CLI. Defaults to the built-in `github.token`, which works on github.com. On GitHub Enterprise, pass a github.com PAT to avoid API rate limiting. | No | `""` (uses `github.token`) | When `spec` is provided, all tools listed in the spec file are added to `PATH` and available by name in subsequent steps. diff --git a/action.yml b/action.yml index b74a330..7669f5a 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,12 @@ inputs: are installed and added to PATH. Omit to skip tool installation. required: false default: "" + only_tools: + description: > + When true (the default), passes `--only-tools` to `luca install`. + Set to false to install both tools and skills defined in the spec file. + required: false + default: "true" github_token: description: > A GitHub token used to authenticate against the github.com API when @@ -48,5 +54,5 @@ runs: if: inputs.spec != '' shell: bash run: | - luca install --spec=${{ inputs.spec }} + luca install --spec=${{ inputs.spec }}${{ inputs.only_tools == 'true' && ' --only-tools' || '' }} echo "$GITHUB_WORKSPACE/.luca/tools" >> $GITHUB_PATH