Enhance Tailscale Receiver scripts and documentation for version 2.2.1. #1
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, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| lint-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y shellcheck shfmt bats | |
| - name: Check script syntax | |
| run: | | |
| for script in *.sh; do | |
| echo "Checking $script..." | |
| bash -n "$script" || exit 1 | |
| done | |
| echo "✅ All scripts have valid syntax" | |
| - name: Run ShellCheck | |
| run: | | |
| find . -name "*.sh" -type f -exec shellcheck {} \; | |
| echo "✅ ShellCheck passed" | |
| - name: Check formatting with shfmt | |
| run: | | |
| shfmt -d -i 2 *.sh | |
| echo "✅ Code formatting is correct" | |
| - name: Run tests | |
| run: | | |
| if [ -d "test" ]; then | |
| cd test | |
| bats *.bats || exit 1 | |
| echo "✅ All tests passed" | |
| else | |
| echo "⚠️ No test directory found" | |
| fi | |
| - name: Validate Makefile | |
| run: | | |
| make help | |
| echo "✅ Makefile is valid" | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| needs: lint-and-test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Tailscale (for integration testing) | |
| run: | | |
| curl -fsSL https://tailscale.com/install.sh | sh | |
| sudo tailscale version | |
| - name: Run smoke tests | |
| run: | | |
| # Test that scripts can be executed (syntax check already done) | |
| chmod +x *.sh | |
| echo "✅ Scripts are executable" | |
| # Test non-interactive install dry-run | |
| if NONINTERACTIVE=true ./install.sh --help 2>/dev/null; then | |
| echo "❌ Install script should not accept --help" | |
| else | |
| echo "✅ Install script properly rejects --help" | |
| fi |