Skip to content

Commit

Permalink
chore: add ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Nov 5, 2024
1 parent 07c510d commit 24268ea
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI

on:
push:
branches:
- master
paths-ignore:
- 'examples/**'
- 'scripts/**'
- 'docs/**'
- '**/*.md'
pull_request:
types:
- 'opened'
- 'synchronize'

jobs:
test:
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [18, 20]
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Run CI
run: pnpm run ci

0 comments on commit 24268ea

Please sign in to comment.