Skip to content

Merge pull request #677 from tsamaya/renovate/vitest-monorepo #1141

Merge pull request #677 from tsamaya/renovate/vitest-monorepo

Merge pull request #677 from tsamaya/renovate/vitest-monorepo #1141

Workflow file for this run

# This workflow builds and tests on the LTS Node version, then runs E2E tests
# against the built artifact across a matrix of supported Node versions.
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
name: Node.js CI
on:
push:
branches:
- main
- release/**
pull_request:
branches:
- main
- release/**
jobs:
build:
name: Build & Test (LTS)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- name: Use Node.js LTS
uses: actions/setup-node@v7
with:
node-version: lts/*
cache: "pnpm"
- run: pnpm install
- run: pnpm lint
- run: pnpm check-types
- run: pnpm test:coverage
- run: pnpm run build
- uses: codecov/codecov-action@v7
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload dist artifact
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
e2e:
name: E2E Node ${{ matrix.node-version }}
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20.x, 22.x, 24.x, 26.x]
# pnpm 11 requires Node >=22, so the e2e job is pnpm-free:
# it downloads the pre-built dist artifact and runs a plain Node script.
steps:
- uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
- name: Download dist artifact
uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- name: Run E2E smoke tests
run: node tests/e2e/smoke.mjs
env:
OPENCAGE_API_KEY: ${{ secrets.OPENCAGE_API_KEY }}