From 54f4ecedabf2be6d94a670b56dc8821095ca3fc9 Mon Sep 17 00:00:00 2001 From: CokaKoala <31664583+AdrianGonz97@users.noreply.github.com> Date: Wed, 30 Aug 2023 09:54:34 -0400 Subject: [PATCH] chore: Add tests to CI (#1984) --- .github/workflows/ci.yml | 32 +++++++++++++++++++++++++++++++- package.json | 2 +- packages/skeleton/src/app.html | 12 ++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 packages/skeleton/src/app.html diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cde0bd5..f12dd9d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - name: Install dependencies run: pnpm install - + - name: Run svelte-check run: pnpm ci:check env: @@ -73,3 +73,33 @@ jobs: - name: Run prettier and eslint run: pnpm ci:lint + test: + name: Run tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - uses: actions/setup-node@v3 + with: + node-version: 18 + + # PNPM Store cache setup + - name: Get pnpm store directory + id: pnpm-cache + run: | + echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT + - name: Setup pnpm cache + uses: actions/cache@v3 + with: + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - name: Run tests + run: pnpm run test diff --git a/package.json b/package.json index dd33c7e3..27d11e1b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "monorepo for @skeletonlabs/skeleton", "private": true, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "pnpm -F @skeletonlabs/skeleton test", "preinstall": "npx only-allow pnpm", "getall": "node scripts/checkout.cjs && pnpm i", "postinstall": "pnpm -r sync", diff --git a/packages/skeleton/src/app.html b/packages/skeleton/src/app.html new file mode 100644 index 00000000..ec615f03 --- /dev/null +++ b/packages/skeleton/src/app.html @@ -0,0 +1,12 @@ + + +
+ + + + %sveltekit.head% + + +