diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ad89276..32fbe1d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,12 @@ name: CI -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: + branches: + - main jobs: commitlint: @@ -11,7 +17,6 @@ jobs: fetch-depth: 0 - name: Install required dependencies run: | - sudo apt install -y git curl curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash - sudo DEBIAN_FRONTEND=noninteractive apt install -y nodejs - name: Print versions @@ -28,3 +33,5 @@ jobs: run: npm run lint - name: Build run: npm run build + - name: Test + run: npm run test diff --git a/.gitignore b/.gitignore index e5cb9e9..80a7bb3 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ vite.config.ts.timestamp-* /.unlighthouse package-lock.json +coverage diff --git a/.prettierignore b/.prettierignore index cc41cea..bf41a87 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,3 +2,4 @@ pnpm-lock.yaml package-lock.json yarn.lock +coverage diff --git a/package.json b/package.json index 9f68b9e..70b7b60 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "preview": "vite preview", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "test": "vitest", + "devtest": "vitest --watch", + "test": "vitest --run --coverage", "lint": "prettier --check . && eslint .", "format": "prettier --check --write .", "prepare": "husky",