post: Notes on Rinha de Backend 2025 #17
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: Continuous Integration | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| check: | |
| name: Check | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: π‘οΈ Harden the runner | |
| uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 | |
| with: | |
| egress-policy: audit | |
| - name: π¦ Checkout | |
| if: github.event_name != 'pull_request' | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: π¦ Checkout | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - name: π³ Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: "22.18.0" | |
| - name: πΎ Cache Node.js modules | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| - name: βοΈ Setup just | |
| uses: extractions/setup-just@v3 | |
| with: | |
| just-version: "1.40.0" | |
| - name: βοΈ Install dependencies | |
| run: just ci | |
| - name: π Check lints and formatting | |
| run: just check | |
| test: | |
| name: Test | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: π‘οΈ Harden the runner | |
| uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 | |
| with: | |
| egress-policy: audit | |
| - name: π¦ Checkout | |
| if: github.event_name != 'pull_request' | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: π¦ Checkout | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - name: π³ Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: "22.18.0" | |
| - name: πΎ Cache Node.js modules | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| - name: βοΈ Setup just | |
| uses: extractions/setup-just@v3 | |
| with: | |
| just-version: "1.40.0" | |
| - name: βοΈ Install dependencies | |
| run: just ci | |
| - name: π§ͺ Run tests | |
| run: just test | |
| - name: β¬οΈ Upload coverage report | |
| uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4 | |
| with: | |
| name: test-coverage | |
| path: coverage/ | |
| test-ui: | |
| name: Test UI | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: π‘οΈ Harden the runner | |
| uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 | |
| with: | |
| egress-policy: audit | |
| - name: π¦ Checkout | |
| if: github.event_name != 'pull_request' | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: π¦ Checkout | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - name: π³ Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: "22.18.0" | |
| - name: πΎ Cache Node.js modules | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| - name: βοΈ Setup just | |
| uses: extractions/setup-just@v3 | |
| with: | |
| just-version: "1.40.0" | |
| - name: βοΈ Install dependencies | |
| run: just ci | |
| - name: πΎ Cache Playwright browsers | |
| id: cache-playwright-browsers | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('**/package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-playwright- | |
| - name: βοΈ Setup Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: π§ͺ Run tests | |
| run: just test-ui | |
| - name: β¬οΈ Upload coverage report | |
| uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4 | |
| with: | |
| name: test-ui-coverage | |
| path: ui-tests-report/ | |
| sonar: | |
| needs: [test, test-ui] | |
| name: Sonar | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: π‘οΈ Harden the runner | |
| uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 | |
| with: | |
| egress-policy: audit | |
| - name: π¦ Checkout | |
| if: github.event_name != 'pull_request' | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: π¦ Checkout | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - name: β¬οΈ Download test coverage report | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: test-coverage | |
| path: coverage/ | |
| - name: β¬οΈ Download test-ui coverage report | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: test-ui-coverage | |
| path: ui-tests-report/ | |
| - name: πΎ Cache SonarCloud packages | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: π SonarCloud Scan | |
| uses: SonarSource/sonarqube-scan-action@8c71dc039c2dd71d3821e89a2b58ecc7fee6ced9 # v5.3.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| build: | |
| needs: [test, test-ui, check, sonar] | |
| name: Build | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: π‘οΈ Harden the runner | |
| uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 | |
| with: | |
| egress-policy: audit | |
| - name: π¦ Checkout | |
| if: github.event_name != 'pull_request' | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: π¦ Checkout | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - name: π³ Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: "22.18.0" | |
| - name: πΎ Cache Node.js modules | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| - name: βοΈ Setup just | |
| uses: extractions/setup-just@v3 | |
| with: | |
| just-version: "1.40.0" | |
| - name: βοΈ Install dependencies | |
| run: just ci | |
| - name: ποΈ Build production output | |
| run: just build | |
| - name: β¬οΈ Upload static website artifact | |
| uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4 | |
| with: | |
| name: blog-${{ github.sha }} | |
| path: dist/blog |