Update dependency @types/react to v19.2.10 #5473
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: Build, test, and deploy | |
| on: | |
| push: | |
| pull_request: | |
| schedule: | |
| # Run once per week to ensure that the pipeline is okay. | |
| - cron: "23 13 * * 0" | |
| permissions: | |
| contents: read | |
| env: | |
| ARTIFACT_NAME: jdkcomparison-site | |
| # Use Node.js LTS. Schedule: https://nodejs.org/en/about/releases/ | |
| NODE_VERSION: 24.x | |
| jobs: | |
| common-checks: | |
| name: Run common checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Run shellcheck on shell scripts | |
| run: find . -name node_modules -prune -o -type f -name "*.sh" -exec shellcheck {} \; | |
| - name: Run Prettier to ensure files are properly formatted | |
| run: npx prettier@`node -p -e "require('./package.json').devDependencies['prettier']"` --check . | |
| build: | |
| name: Build and test | |
| runs-on: ubuntu-latest | |
| needs: | |
| - common-checks | |
| permissions: | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: Lint | |
| run: npm run lint | |
| - name: Run unit tests | |
| run: npm run jest | |
| - name: Build page with test data | |
| env: | |
| DATA_SOURCE: testdata | |
| run: npm run build | |
| # Start http-server to serve `out`, put it in the background, and run the tests. Stop http-server once the tests | |
| # are run. | |
| - name: Run E2E tests | |
| run: | | |
| npx http-server -p 3000 out > /dev/null 2>&1 & | |
| PID=$! | |
| npm run e2e | |
| kill "$PID" | |
| - name: Remove page with test data | |
| run: rm -rf out | |
| - name: Build | |
| run: npm run build | |
| # Upload build output before anything can alter it. | |
| - name: Upload artifact for deployment job | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ env.ARTIFACT_NAME }} | |
| path: out | |
| - name: Publish Test Results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: always() | |
| with: | |
| check_name: Test Results of Node.js ${{ env.NODE_VERSION }} | |
| files: | | |
| build/reports/*.xml | |
| deploy-preview: | |
| name: Deploy preview | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| permissions: | |
| contents: read | |
| deployments: write | |
| pull-requests: write | |
| outputs: | |
| preview-url: ${{ steps.cloudflare-deployment.outputs.deployment-url }} | |
| steps: | |
| - name: Set PREVIEW_NAME for main branch | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| echo "PREVIEW_NAME=main-preview" >> $GITHUB_ENV | |
| - name: Set PREVIEW_NAME for all branches other than main | |
| if: github.ref != 'refs/heads/main' | |
| run: | | |
| echo "PREVIEW_NAME=${{ github.ref_name }}" >> $GITHUB_ENV | |
| - name: Download artifact from build job | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: ${{ env.ARTIFACT_NAME }} | |
| path: site | |
| - name: Publish to Cloudflare Pages | |
| id: cloudflare-deployment | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy site --project-name=jdkcomparison --branch=${{ env.PREVIEW_NAME }} | |
| - uses: mshick/add-pr-comment@v2 | |
| with: | |
| message: | | |
| ### <span aria-hidden="true">✅</span> Your deployment is ready! | |
| | Name | Link | | |
| |-|-| | |
| |Deployed Commit | ${{ github.sha }} | | |
| |Workflow Log | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | | |
| |Preview URL | ${{ steps.cloudflare-deployment.outputs.deployment-url }} | | |
| --- | |
| acceptance: | |
| name: Run acceptance tests | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| - deploy-preview | |
| permissions: | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| env: | |
| PLAYWRIGHT_BASE_URL: ${{ needs.deploy-preview.outputs.preview-url }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: Run acceptance tests | |
| run: | | |
| echo "Run acceptance tests against ${{ env.PLAYWRIGHT_BASE_URL }}" | |
| npm run acceptance | |
| deploy-to-production: | |
| name: Deploy to production | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| - acceptance | |
| permissions: | |
| contents: read | |
| deployments: write | |
| pull-requests: write | |
| steps: | |
| - name: Download artifact from build job | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: ${{ env.ARTIFACT_NAME }} | |
| path: site | |
| - name: Publish to Cloudflare Pages | |
| id: cloudflare-deployment | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy site --project-name=jdkcomparison --branch=${{ github.ref_name }} |