Skip to content

Commit

Permalink
chore: setup ci
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Oct 1, 2023
1 parent 4760241 commit 65be890
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 11 deletions.
68 changes: 58 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,87 @@
name: Test
name: CI

on:
push:
branches:
- main
- master

pull_request:
branches:
- main
- master

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Lint
run: nr lint

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Typecheck
run: nr typecheck

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

strategy:
matrix:
node-version: [14.x, 16.x]
node: [lts/*]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Set node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.node }}

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Build
run: nr build

- name: Test
run: nr build && nr test
run: nr test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"build": "unbuild",
"lint": "eslint .",
"release": "bumpp && npm publish",
"typecheck": "tsc --noEmit",
"test": "vitest run && node ./test/cjs.cjs && node ./test/esm.mjs"
},
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"esModuleInterop": true,
"strict": true,
"strictNullChecks": true,
"skipDefaultLibCheck": true
"skipDefaultLibCheck": true,
"skipLibCheck": true
}
}

0 comments on commit 65be890

Please sign in to comment.