From 048f09dd5bef9898e5adb9d49fb8cc8707c81432 Mon Sep 17 00:00:00 2001 From: Franck Cornu Date: Mon, 27 Nov 2023 07:34:53 -0500 Subject: [PATCH] - Updated workflow to include tests --- .github/workflows/publish.yml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 27aeb3e..c0a6194 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -40,10 +40,42 @@ jobs: echo "majorMinorPatch=$GITVERSION_MAJORMINORPATCH" >> "$GITHUB_OUTPUT" echo "semver=$GITVERSION_SEMVER" >> "$GITHUB_OUTPUT" + tests: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - name: Tests + run: pnpm run test + publish: runs-on: ubuntu-latest - needs: version + needs: [version, tests] defaults: run: working-directory: ./packages/components