Give the e2e-server a real v2-primary lane and delete the /api/send shadows (rebuild W3 PR-F) #281
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: Test | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| env: | |
| GO_COVERAGE_MIN: "40.0" | |
| jobs: | |
| go-test: | |
| name: Go Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Run Go test suite with coverage | |
| run: go test ./... -coverprofile=coverage.out | |
| - name: Summarize Go coverage | |
| run: | | |
| go tool cover -func=coverage.out | tee coverage.txt | |
| total=$(awk '/^total:/ {gsub("%", "", $NF); print $NF}' coverage.txt) | |
| echo "total=${total}" >> "$GITHUB_OUTPUT" | |
| id: coverage | |
| - name: Enforce Go coverage floor | |
| run: | | |
| awk -v total="${{ steps.coverage.outputs.total }}" -v min="${GO_COVERAGE_MIN}" 'BEGIN { exit !(total + 0 >= min + 0) }' | |
| - name: Upload Go coverage artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: go-coverage | |
| path: | | |
| coverage.out | |
| coverage.txt | |
| go-race: | |
| name: Go Race | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Run Go race suite | |
| run: go test -race ./... | |
| e2e: | |
| name: Web E2E | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Install Node dependencies | |
| run: npm ci | |
| - name: Install Playwright browser | |
| run: npx playwright install --with-deps chromium | |
| - name: Run Playwright suite | |
| run: npm run test:e2e | |
| - name: Upload Playwright artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-artifacts | |
| if-no-files-found: ignore | |
| path: | | |
| playwright-report/ | |
| test-results/ | |
| site-build: | |
| name: Site Build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| defaults: | |
| run: | |
| working-directory: site | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: site/package-lock.json | |
| - name: Install site dependencies | |
| run: npm ci | |
| - name: Build marketing site | |
| run: npm run build | |
| macos-build: | |
| name: macOS App Build | |
| runs-on: macos-latest | |
| timeout-minutes: 25 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Guard against the stale root Xcode tree | |
| run: | | |
| if [ -e OpenMessage/OpenMessage.xcodeproj ] || [ -e OpenMessage/Info.plist ]; then | |
| echo "::error::The stale root OpenMessage/ tree is back. The app is built from the SwiftPM package at macos/OpenMessage; delete the root OpenMessage/ directory." | |
| exit 1 | |
| fi | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Build Swift package | |
| run: swift build --package-path macos/OpenMessage | |
| - name: Build Go backend for Swift smoke | |
| run: GOWORK=off go build -o "$RUNNER_TEMP/openmessage" . | |
| - name: Test Swift package | |
| env: | |
| OPENMESSAGE_BINARY: ${{ runner.temp }}/openmessage | |
| run: swift test --package-path macos/OpenMessage | |
| - name: Package macOS app | |
| run: bash macos/build.sh |