NPM Package Test #58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: NPM Package Test | |
| on: | |
| schedule: | |
| # Run daily at 6:00 AM UTC | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Package version to test (e.g., "latest", "0.6.0", "next")' | |
| required: false | |
| default: 'latest' | |
| type: string | |
| jobs: | |
| test-npm-package: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Create test project | |
| run: | | |
| mkdir test-project | |
| cd test-project | |
| git init | |
| - name: Determine package version | |
| id: version | |
| run: | | |
| VERSION="${{ inputs.version || 'latest' }}" | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Testing claude-auto@$VERSION" | |
| - name: Install claude-auto via npx | |
| working-directory: test-project | |
| run: | | |
| echo "Installing claude-auto@${{ steps.version.outputs.version }}..." | |
| npx claude-auto@${{ steps.version.outputs.version }} install | |
| - name: Verify installation structure | |
| working-directory: test-project | |
| run: | | |
| echo "=== .claude directory ===" | |
| ls -la .claude/ || echo "No .claude directory" | |
| echo "" | |
| echo "=== .claude-auto/scripts ===" | |
| ls -la .claude-auto/scripts/ || echo "No scripts directory" | |
| echo "" | |
| echo "=== .claude/settings.json ===" | |
| cat .claude/settings.json || echo "No settings.json" | |
| echo "" | |
| echo "=== .claude-auto directory ===" | |
| ls -la .claude-auto/ || echo "No .claude-auto directory" | |
| - name: Verify settings.json has hooks | |
| working-directory: test-project | |
| run: | | |
| node -e " | |
| const s = require('./.claude/settings.json'); | |
| const hooks = ['SessionStart', 'PreToolUse', 'UserPromptSubmit', 'Stop']; | |
| for (const h of hooks) { | |
| if (!s.hooks[h]) { console.error('Missing hook: ' + h); process.exit(1); } | |
| } | |
| console.log('All hooks present'); | |
| " | |
| - name: Verify scripts are copied (not symlinks) | |
| working-directory: test-project | |
| run: | | |
| for script in session-start.js pre-tool-use.js user-prompt-submit.js auto-continue.js; do | |
| if [ ! -f ".claude-auto/scripts/$script" ]; then | |
| echo "FAIL: Missing script $script" | |
| exit 1 | |
| fi | |
| if [ -L ".claude-auto/scripts/$script" ]; then | |
| echo "FAIL: $script is a symlink, should be a regular file" | |
| exit 1 | |
| fi | |
| echo "OK: $script is a regular file" | |
| done |