From 90aeabbd76b958140cb39f701bd599a7805a548c Mon Sep 17 00:00:00 2001 From: Austin Sullivan Date: Wed, 2 Nov 2022 09:09:48 -0400 Subject: [PATCH] add testing gh action --- .github/workflows/release.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0ba57b..ab13c18 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,3 +75,44 @@ jobs: run: yarn lint:js - name: MDLint run: yarn lint:md + test_jest: + runs-on: ubuntu-latest + env: + GH_PR_NUM: ${{ github.event.number }} + needs: build + steps: + - uses: actions/checkout@v2 + # Yes, we really want to checkout the PR + - run: | + if [[ ! -z "${GH_PR_NUM}" ]]; then + echo "Checking out PR" + git fetch origin pull/$GH_PR_NUM/head:tmp + git checkout tmp + fi + - uses: actions/setup-node@v1 + with: + node-version: '14' + - uses: actions/cache@v2 + id: yarn-cache + name: Cache npm deps + with: + path: | + node_modules + **/node_modules + ~/.cache/Cypress + key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }} + - run: yarn install --frozen-lockfile + if: steps.yarn-cache.outputs.cache-hit != 'true' + - uses: actions/cache@v2 + id: dist + name: Cache dist + with: + path: | + packages/*/dist + packages/react-styles/css + key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }} + - name: Build dist + run: yarn build + if: steps.dist.outputs.cache-hit != 'true' + - name: PF4 Jest Tests + run: yarn test --maxWorkers=2