Skip to content

feat: modernize cross-env with TypeScript, Vitest, and ESM-only build #31

feat: modernize cross-env with TypeScript, Vitest, and ESM-only build

feat: modernize cross-env with TypeScript, Vitest, and ESM-only build #31

Workflow file for this run

name: Validate
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: πŸ”¨ Build and Validate
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22, 24]
steps:
- name: πŸ“₯ Checkout
uses: actions/checkout@v4
- name: 🟒 Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: πŸ“¦ Install dependencies
run: npm ci
- name: πŸ”¨ Build
run: npm run build
- name: πŸ” Type check
run: npm run typecheck
- name: 🧹 Lint
run: npm run lint
- name: πŸ§ͺ Test
run: npm run test:run
- name: πŸ“Š Upload coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: πŸ’Ύ Cache build output
uses: actions/cache@v4
with:
path: dist
# prettier-ignore
key: dist-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
dist-${{ matrix.node-version }}-
e2e:
name: 🌐 E2E Tests
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [24]
steps:
- name: πŸ“₯ Checkout
uses: actions/checkout@v4
- name: 🟒 Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: πŸ“¦ Install dependencies
run: npm ci
# ensure we don't implicitly rely on dev dependencies
- name: πŸ“¦ Prune dependencies
run: npm prune --production
- name: πŸ“‚ Restore build output
uses: actions/cache@v4
with:
path: dist
# prettier-ignore
key: dist-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
dist-${{ matrix.node-version }}-
- name: πŸ§ͺ Run cross-env e2e tests
run: node e2e/test-cross-env.js
- name: 🐚 Run cross-env-shell e2e tests
run: node e2e/test-cross-env-shell.js