Skip to content

Commit

Permalink
chore: update CI configuration and add typecheck job
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed Feb 13, 2025
1 parent 6b97ca3 commit 4e96280
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
59 changes: 29 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,19 @@ on:
branches:
- main

merge_group: {}

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

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
uses: pnpm/action-setup@v3

- name: Set node
uses: actions/setup-node@v4
with:
node-version: 18.18.2
cache: pnpm
node-version: lts/*

- name: Setup
run: npm i -g @antfu/ni
Expand All @@ -37,40 +32,47 @@ jobs:
- name: Lint
run: nr lint

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

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

- name: Set node
uses: actions/setup-node@v4
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:
os: [ubuntu-latest]
node_version: [18.18.2, lts/*]
include:
- os: macos-latest
node_version: lts/*
- os: windows-latest
node_version: lts/*
node: [lts/*]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
uses: pnpm/action-setup@v3

- name: Set node ${{ matrix.node_version }}
- name: Set node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: pnpm

- run: corepack enable
node-version: ${{ matrix.node }}

- name: Setup
run: npm i -g @antfu/ni
Expand All @@ -83,6 +85,3 @@ jobs:

- name: Test
run: nr test

- name: Typecheck
run: nr typecheck
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@simon_he/pi",
"type": "module",
"version": "0.0.98",
"packageManager": "[email protected]",
"description": "A powerful and flexible command-line tool for managing projects.",
"author": "Simon He",
"license": "MIT",
Expand Down

0 comments on commit 4e96280

Please sign in to comment.