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
104 changes: 104 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Loading