| name: Test |
|
|
| on: |
| push: |
| branches-ignore: |
| - 'dependabot/**' |
| paths: |
| - 'lib/**' |
| - 'package.json' |
| - 'pnpm-lock.yaml' |
| - '.github/workflows/test.yml' |
| pull_request: {} |
|
|
| permissions: |
| checks: write |
|
|
| jobs: |
| vitest: |
| runs-on: ubuntu-latest |
| timeout-minutes: 10 |
| services: |
| redis: |
| image: redis |
| ports: |
| - 6379/tcp |
| options: --entrypoint redis-server |
| strategy: |
| fail-fast: false |
| matrix: |
| node-version: [latest, lts/*, lts/-1] |
| name: Vitest on Node ${{ matrix.node-version }} |
| steps: |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd |
| - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 |
| - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 |
| with: |
| node-version: ${{ matrix.node-version }} |
| cache: 'pnpm' |
| - name: Install dependencies (pnpm) |
| run: pnpm i |
| - name: Run postinstall script for dependencies |
| run: pnpm rb && pnpx rebrowser-puppeteer browsers install chrome |
| - name: Build routes |
| run: pnpm build |
| - name: Build worker routes |
| run: WORKER_BUILD=true pnpm build:routes |
| - name: Build worker |
| run: pnpm worker-build |
| - name: Test all and generate coverage |
| run: pnpm run vitest:coverage --reporter=github-actions |
| env: |
| REDIS_URL: redis://localhost:${{ job.services.redis.ports['6379'] }}/ |
| - name: Upload coverage to Codecov |
| if: ${{ matrix.node-version == 'lts/*' }} |
| uses: codecov/codecov-action@v5 |
| with: |
| token: ${{ secrets.CODECOV_TOKEN }} |
|
|
| puppeteer: |
| runs-on: ubuntu-latest |
| timeout-minutes: 10 |
| strategy: |
| fail-fast: false |
| matrix: |
| node-version: [latest, lts/*, lts/-1] |
| chromium: |
| - name: bundled Chromium |
| dependency: '' |
| environment: '{ "PUPPETEER_SKIP_DOWNLOAD": "0" }' |
| - name: Chromium from Ubuntu |
| dependency: chromium-browser |
| environment: '{ "PUPPETEER_SKIP_DOWNLOAD": "1" }' |
| - name: Chrome from Google |
| dependency: google-chrome-stable |
| environment: '{ "PUPPETEER_SKIP_DOWNLOAD": "1" }' |
| name: Vitest puppeteer on Node ${{ matrix.node-version }} with ${{ matrix.chromium.name }} |
| steps: |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd |
| - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 |
| - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 |
| with: |
| node-version: ${{ matrix.node-version }} |
| cache: 'pnpm' |
| - name: Install dependencies (pnpm) |
| run: pnpm i |
| env: ${{ fromJSON(matrix.chromium.environment) }} |
| - name: Run postinstall script for dependencies |
| run: pnpm rb && pnpx rebrowser-puppeteer browsers install chrome |
| env: ${{ fromJSON(matrix.chromium.environment) }} |
| - name: Build routes |
| run: pnpm build |
| env: ${{ fromJSON(matrix.chromium.environment) }} |
| - name: Install Chromium |
| if: ${{ matrix.chromium.dependency != '' }} |
| |
| |
| |
| |
| run: | |
| set -eux |
| curl -s "https://dl.google.com/linux/linux_signing_key.pub" | gpg --dearmor | |
| sudo tee /etc/apt/trusted.gpg.d/google-chrome.gpg > /dev/null |
| echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" | |
| sudo tee /etc/apt/sources.list.d/google-chrome.list > /dev/null |
| sudo apt-get update |
| sudo apt-get install -yq --no-install-recommends ${{ matrix.chromium.dependency }} |
| - name: Test puppeteer |
| run: | |
| set -eux |
| export CHROMIUM_EXECUTABLE_PATH="$(which ${{ matrix.chromium.dependency }})" |
| pnpm run vitest puppeteer |
| env: ${{ fromJSON(matrix.chromium.environment) }} |
|
|
| all: |
| runs-on: ubuntu-latest |
| timeout-minutes: 5 |
| permissions: |
| attestations: write |
| strategy: |
| fail-fast: false |
| matrix: |
| node-version: [24, 22, 20] |
| name: Build radar and maintainer on Node ${{ matrix.node-version }} |
| steps: |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd |
| - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 |
| - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 |
| with: |
| node-version: ${{ matrix.node-version }} |
| cache: 'pnpm' |
| - run: pnpm i |
| - name: Build radar and maintainer |
| run: npm run build |
| - name: Upload assets |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f |
| with: |
| name: generated-assets-${{ matrix.node-version }} |
| path: assets/build/ |
|
|
| automerge: |
| if: github.triggering_actor == 'dependabot[bot]' && github.event_name == 'pull_request' |
| needs: [vitest, puppeteer, all] |
| runs-on: ubuntu-slim |
| permissions: |
| pull-requests: write |
| contents: write |
| steps: |
| - uses: fastify/github-action-merge-dependabot@1b2ed42db8f9d81a46bac83adedfc03eb5149dff |
| with: |
| github-token: ${{ secrets.GITHUB_TOKEN }} |
| target: patch |
|
|