Feature/osa package with ai tooling guards #10
Workflow file for this run
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: Tests | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| test: | |
| name: OSA Snippets Tests | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Cache Homebrew | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/Library/Caches/Homebrew | |
| key: ${{ runner.os }}-homebrew-${{ hashFiles('**/Brewfile') }} | |
| restore-keys: | | |
| ${{ runner.os }}-homebrew- | |
| - name: Install dependencies | |
| run: | | |
| brew install bats-core | |
| echo "✓ bats version: $(bats --version)" | |
| echo "✓ zsh version: $(zsh --version)" | |
| - name: Run test suite | |
| run: | | |
| echo "Running OSA Snippets test suite..." | |
| bats tests/*.bats | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Install JS dependencies | |
| run: | | |
| echo "Installing JavaScript dependencies..." | |
| cd js | |
| yarn install --immutable | |
| - name: Run vitest tests | |
| run: | | |
| echo "Running vitest test suite..." | |
| cd js | |
| yarn test | |
| - name: Test entry.zsh loading | |
| run: | | |
| echo "Testing entry.zsh configuration flag handling..." | |
| # Test with git flag | |
| output=$(OSA_SETUP_GIT=true zsh -c "source entry.zsh && alias prune" 2>/dev/null) | |
| echo "$output" | grep -q "git fetch -p" | |
| echo "✓ Git aliases load correctly" | |
| # Test with node flag | |
| output=$(OSA_SETUP_NODE=true zsh -c "source entry.zsh && alias nr" 2>/dev/null) | |
| echo "$output" | grep -q "npm run" | |
| echo "✓ NPM aliases load correctly" | |
| - name: Verify required files | |
| run: | | |
| echo "Verifying required files..." | |
| [[ -f "entry.zsh" ]] && echo "✓ entry.zsh exists" | |
| [[ -f "README.md" ]] && echo "✓ README.md exists" | |
| [[ -d "plugins" ]] && echo "✓ plugins directory exists" | |
| [[ -d "aliases" ]] && echo "✓ aliases directory exists" | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: test-results | |
| path: tests/*.bats | |
| retention-days: 30 |