From 5bc8bb1f0328dbba879a4ef03164cbf68f35d9dc Mon Sep 17 00:00:00 2001 From: peetzweg/ Date: Tue, 6 Feb 2024 11:11:46 +0100 Subject: [PATCH] adds github workflow --- .github/workflows/test.yml | 43 ++++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4420eb4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: Run Testsuite + +on: + pull_request: + branches: + - master + + jobs: + release: + name: Release + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20] + pnpm-version: [8.11] + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits + fetch-depth: 0 + submodules: true + + - name: Set up pnpm action ${{ matrix.pnpm-version }} + uses: pnpm/action-setup@v2 + with: + version: ${{ matrix.pnpm-version }} + + - name: Set up Node ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + cache: 'pnpm' + node-version: ${{ matrix.node-version }} + + - name: Install Dependencies + run: pnpm install --frozen-lockfile + + - name: Run Unit Tests + run: pnpm test:ci + + - name: Run Coverage Analysis + run: pnpm coverage \ No newline at end of file diff --git a/package.json b/package.json index df1114b..4b1103e 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "scripts": { "build": "tsup", "test": "vitest", + "test:ci": "vitest run", "coverage": "vitest run --coverage", "dev": "tsup --watch", "dev:react-example": "concurrently \"pnpm run dev\" \"pnpm run -F \"{examples/react-ts}\" dev\"",