Repository navigation
feat(web): show the build commit and time in the footer (#3788) #4712
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: Main | |
| on: push | |
| permissions: | |
| contents: read | |
| jobs: | |
| checks: | |
| runs-on: ubuntu-latest | |
| name: ${{ matrix.script-name }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| script-name: [lint, build] | |
| steps: | |
| - name: Checkout the repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Cache node modules | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Setup node | |
| uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | |
| with: | |
| node-version-file: package.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Running ${{ matrix.script-name }} | |
| run: npm run ${{ matrix.script-name }} | |
| env: | |
| # The build has no Firestore to read content from, so it builds the pages without content. | |
| FIRESTORE_TARGET: none | |
| test-project: | |
| runs-on: ubuntu-latest | |
| name: test (${{ matrix.project }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| project: [Web, Server, Hydration, Functions, CLI, Firestore, Translations] | |
| steps: | |
| - name: Checkout the repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Cache node modules | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Setup node | |
| uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | |
| with: | |
| node-version-file: package.json | |
| - name: Setup Java (required by the Firestore emulator) | |
| if: matrix.project == 'Firestore' | |
| uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Running ${{ matrix.project }} tests | |
| run: npx vitest run --project ${{ matrix.project }} | |
| # Builds the site with each feature off, and builds a minimal site. | |
| smoke: | |
| runs-on: ubuntu-latest | |
| name: smoke | |
| steps: | |
| - name: Checkout the repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Cache node modules | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Setup node | |
| uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | |
| with: | |
| node-version-file: package.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Running smoke tests | |
| run: npx vitest run --project 'Smoke*' | |
| # One required check that passes only when every test project and the smoke tests pass. | |
| test: | |
| runs-on: ubuntu-latest | |
| name: test | |
| needs: [test-project, smoke] | |
| if: always() | |
| steps: | |
| - name: Check test results | |
| run: | | |
| test "${{ needs.test-project.result }}" = success | |
| test "${{ needs.smoke.result }}" = success |