feat: add integration test infrastructure with E2E SMS tests #4
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: integration-test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| integration-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout 🛎 | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| - name: Generate Firebase credentials | |
| run: | | |
| bash tests/generate-firebase-credentials.sh tests/firebase-credentials.json | |
| echo "FIREBASE_CREDENTIALS=$(jq -c . tests/firebase-credentials.json)" >> $GITHUB_ENV | |
| - name: Start services 🐳 | |
| working-directory: ./tests | |
| run: docker compose up -d --build --wait | |
| - name: Wait for seed to complete | |
| working-directory: ./tests | |
| run: | | |
| echo "Waiting for seed container to finish..." | |
| docker compose wait seed || true | |
| sleep 2 | |
| - name: Run integration tests 🧪 | |
| working-directory: ./tests | |
| run: go test -v -timeout 120s ./... | |
| - name: Collect logs on failure 📋 | |
| if: failure() | |
| working-directory: ./tests | |
| run: | | |
| docker compose logs api | |
| docker compose logs emulator | |
| - name: Stop services 🛑 | |
| if: always() | |
| working-directory: ./tests | |
| run: docker compose down -v |