Skip to content

Commit

Permalink
ci(test): create job matrix & rename test:lintlint
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobJingleheimer committed Nov 21, 2024
1 parent bcbed74 commit 6cb3a8a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
40 changes: 22 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,50 @@
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
# For more information see: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow

name: CI

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

jobs:
Lint:
OS-independent:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [23.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run test:lint
- run: npm run lint
- run: npm run test:types

Test:
runs-on:
macos-latest
ubuntu-latest
windows-latest

OS-dependent:
strategy:
fail-fast: false
matrix:
node-version: [23.x, 22.x, 20.x]
fail-fast: false
node:
- version: 23.x
- version: 22.x
- version: 20.x
os:
- macos-latest
- ubuntu-latest
- windows-latest

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node.version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.node.version }}
cache: 'npm'
- run: npm ci
- run: npm run test:unit
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A collection of migration recipes for userland code.",
"scripts": {
"test:e2e": "node --no-warnings --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=./coverage.lcov --test-reporter=spec --test-reporter-destination=stdout --import './build/snapshots.ts' -test --test-coverage-include='recipes/**/*' --test-coverage-exclude='**/*.e2e.m(j|t)s' './packages/*/*.e2e.m(j|t)s'",
"test:lint": "biome lint ./recipes",
"lint": "biome lint ./recipes",
"test:types": "tsc",
"test:unit": "node --no-warnings --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=./coverage.lcov --test-reporter=spec --test-reporter-destination=stdout --experimental-test-module-mocks --import './build/snapshots.ts' -test --test-coverage-include='recipes/**/*' --test-coverage-exclude='**/*.spec.m(j|t)s' --test-coverage-lines=0.8 './packages/*/*.spec.m(j|t)s'"
},
Expand Down

0 comments on commit 6cb3a8a

Please sign in to comment.