diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..9dea2975b --- /dev/null +++ b/.github/workflows/tests.yml @@ -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 diff --git a/package.json b/package.json index 28a0928c0..e6b20b49b 100644 --- a/package.json +++ b/package.json @@ -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"