feat: v3.0.1 release #258
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| # Run tests in parallel | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Build Web UI | |
| working-directory: web | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Read Go version | |
| id: goversion | |
| run: echo "version=$(grep '^go ' go.mod | awk '{print $2}')" >> "$GITHUB_OUTPUT" | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ steps.goversion.outputs.version }} | |
| - name: Build | |
| run: go build ./... | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Unit Tests | |
| run: go test -race -count=1 -short ./... | |
| - name: Check coverage thresholds | |
| run: | | |
| check_pkg() { | |
| pkg=$1 | |
| threshold=$2 | |
| output=$(go test -cover "./${pkg}" 2>&1) | |
| pct=$(echo "$output" | sed -n 's/.*coverage: \([0-9]*\.[0-9]*\)%.*/\1/p') | |
| if [ -z "$pct" ]; then pct="0"; fi | |
| int_pct=$(echo "$pct" | cut -d. -f1) | |
| if [ "$int_pct" -lt "$threshold" ]; then | |
| echo "FAIL: ${pkg} coverage ${pct}% < ${threshold}%" | |
| return 1 | |
| fi | |
| echo "OK: ${pkg} coverage ${pct}% >= ${threshold}%" | |
| return 0 | |
| } | |
| failed=0 | |
| # Core modules | |
| check_pkg "internal/config" 80 || failed=1 | |
| check_pkg "internal/proxy" 80 || failed=1 | |
| check_pkg "internal/proxy/transform" 80 || failed=1 | |
| check_pkg "internal/web" 80 || failed=1 | |
| check_pkg "internal/bot" 80 || failed=1 | |
| check_pkg "internal/daemon" 50 || failed=1 | |
| check_pkg "internal/update" 50 || failed=1 | |
| check_pkg "internal/sync" 50 || failed=1 | |
| exit $failed | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Build Web UI | |
| working-directory: web | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Read Go version | |
| id: goversion | |
| run: echo "version=$(grep '^go ' go.mod | awk '{print $2}')" >> "$GITHUB_OUTPUT" | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ steps.goversion.outputs.version }} | |
| - name: Integration Tests | |
| run: go test -race -count=1 -timeout 240s ./tests/integration/... | |
| env: | |
| SKIP_FLAKY_TESTS: "true" # Skip flaky E2E tests in main CI | |
| web-tests: | |
| name: Web UI Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Build Web UI | |
| working-directory: web | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Test Web UI | |
| working-directory: web | |
| run: npm run test:coverage | |
| website: | |
| name: Website Build | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: website | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run build | |