Generalize Stratified Cluster Sampling for city corporations #17
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
| --- | |
| # ABOUTME: GitHub Actions workflow for validating pull requests. | |
| # ABOUTME: Runs tests and validates Docker build without pushing. | |
| name: PR Check | |
| "on": | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| paths: | |
| - 'truecover-app/**' | |
| - '.github/workflows/pr-check.yml' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./truecover-app | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Cache bun dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('truecover-app/bun.lockb') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Run TypeScript check and build | |
| run: bun run build | |
| - name: Run tests | |
| run: bun run test | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image (validation only) | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./truecover-app | |
| file: ./truecover-app/Dockerfile | |
| push: false | |
| tags: truecover-app:pr-${{ github.event.pull_request.number }} | |
| build-args: | | |
| VITE_MAPBOX_TOKEN=${{ secrets.VITE_MAPBOX_TOKEN }} | |
| VITE_CLERK_PUBLISHABLE_KEY=${{ | |
| secrets.VITE_CLERK_PUBLISHABLE_KEY }} | |
| VITE_API_URL=${{ secrets.VITE_API_URL }} | |
| VITE_MARTIN_URL=${{ secrets.VITE_MARTIN_URL }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Build validation complete | |
| env: | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| echo "## Docker Build Validation" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Docker image built successfully for PR #$PR_NUMBER" \ | |
| >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Note:** Image was not pushed to registry" \ | |
| >> $GITHUB_STEP_SUMMARY |