Skip to content

Commit

Permalink
Running tests as part of CI (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
iwoplaza authored Jul 8, 2024
1 parent 2d96653 commit 4e5bca4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Tests

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

jobs:
# Runs all steps on the VM
test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18.x, 20.x, 22.x]

steps:
- name: Checkout Code Repository
uses: actions/checkout@v2

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false

- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- run: pnpm i --frozen-lockfile
- run: pnpm ci:test
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"build": "tsup",
"prettier": "prettier '*.{js,json,md}' '{src,tests,benchmarks,docs}/**/*.{ts,tsx,md,mdx}' --write",
"eslint": "eslint --fix --no-eslintrc --c .eslintrc.json '*.{js,json,ts}' '{packages/apps}/**/*.{ts,tsx}'",
"test": "vitest --ui --coverage"
"test": "vitest",
"coverage": "vitest --coverage",
"ci:test": "vitest --run"
},
"engines": {
"node": ">=12.20.0"
Expand Down

0 comments on commit 4e5bca4

Please sign in to comment.