fix: detect kavex source repo in activate to use correct hook paths #26
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| name: ShellCheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install shellcheck | |
| run: sudo apt-get install -y shellcheck | |
| - name: Lint all shell scripts | |
| run: shellcheck -x -S warning scripts/kavex scripts/kavex-monitor install.sh hooks/*.sh hooks/lib/*.sh | |
| test: | |
| name: Bats Tests | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Install jq | |
| run: | | |
| if ! command -v jq &>/dev/null; then | |
| if [ "$(uname)" = "Darwin" ]; then | |
| brew install jq | |
| else | |
| sudo apt-get install -y jq | |
| fi | |
| fi | |
| - name: Run unit tests | |
| run: npx bats --tap tests/unit 2>&1 | tee unit.tap | |
| - name: Run integration tests | |
| run: npx bats --tap tests/integration 2>&1 | tee integration.tap | |
| - name: Run regression tests | |
| run: npx bats --tap tests/regression 2>&1 | tee regression.tap | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ matrix.os }} | |
| path: | | |
| unit.tap | |
| integration.tap | |
| regression.tap | |
| - name: Test Summary | |
| if: failure() | |
| run: | | |
| echo "## Test Results (${{ matrix.os }})" >> "$GITHUB_STEP_SUMMARY" | |
| for f in unit.tap integration.tap regression.tap; do | |
| if [ -f "$f" ]; then | |
| echo "### $(basename "$f" .tap)" >> "$GITHUB_STEP_SUMMARY" | |
| echo '```' >> "$GITHUB_STEP_SUMMARY" | |
| tail -20 "$f" >> "$GITHUB_STEP_SUMMARY" | |
| echo '```' >> "$GITHUB_STEP_SUMMARY" | |
| fi | |
| done | |