diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 57fb0f63a..e0eeea8a4 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -9,3 +9,7 @@ Runs on every pull request and validates whether the PR title follows the [Gitmo ## [🎨 lint.yml](lint.yml) Checks the code style of the project. + +## [🧑‍🔧 test.yml](test.yml) + +Runs tests. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..bf103c225 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +name: 🧑‍🔧 Test + +on: + push: + branches: + - new-dawn + pull_request: + +jobs: + test: + name: Run tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: pnpm/action-setup@v2 + with: + version: 8.7.6 + + - uses: actions/setup-node@v3 + with: + node-version-file: ".nvmrc" + registry-url: https://registry.npmjs.org + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Run tests + run: pnpm run test diff --git a/package.json b/package.json index 63af092bb..5efbbedbd 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "lint:unsafe": "biome check . --apply-unsafe", "prepare": "husky install", "sort-package-json": "sort-package-json 'package.json' 'packages/*/package.json' 'examples/*/package.json'", - "sort-package-json:check": "sort-package-json 'package.json' 'packages/*/package.json' 'examples/*/package.json' --check" + "sort-package-json:check": "sort-package-json 'package.json' 'packages/*/package.json' 'examples/*/package.json' --check", + "test": "turbo test" }, "lint-staged": { "package.json": "sort-package-json" diff --git a/packages/core/package.json b/packages/core/package.json index 6a5e3429b..4ff19d06e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -24,7 +24,8 @@ "lint": "biome check . --apply", "lint:check": "biome check . --verbose", "lint:unsafe": "biome check . --apply-unsafe", - "test": "vitest", + "test": "vitest run", + "test:watch": "vitest watch", "types:check": "tsc --noEmit" }, "devDependencies": { diff --git a/turbo.json b/turbo.json index c1e633f83..33100bcd4 100644 --- a/turbo.json +++ b/turbo.json @@ -3,6 +3,7 @@ "pipeline": { "build": { "outputs": ["dist/**", "types/**"] - } + }, + "test": {} } }