From 3cca4f788dcd7b7d65448b5d52dd2899c13eb12e Mon Sep 17 00:00:00 2001 From: Mark Linn Date: Sat, 9 Sep 2023 18:09:31 +0200 Subject: [PATCH 1/2] chore: updating workflow to run cypress only on PRs to Main --- .github/workflows/test.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cba9c810..446ecd62 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v2 with: - node-version: "18" # current LTS (we have 16 in Docker) + node-version: "18" - name: Install dependencies run: yarn install @@ -27,4 +27,9 @@ jobs: run: yarn test - name: Run Cypress tests - run: yarn cypress + run: | + if [[ ${{ github.event.pull_request.base.ref }} == 'main' ]]; then + yarn cypress + else + echo "Skipping Cypress tests for non-main branch." + fi From e6e994265eec31bcd71400a5c0eed5c68baff551 Mon Sep 17 00:00:00 2001 From: Dan Ko Date: Sat, 9 Sep 2023 12:12:44 -0400 Subject: [PATCH 2/2] add cypress script to pre-push hook --- .husky/pre-push | 1 + 1 file changed, 1 insertion(+) diff --git a/.husky/pre-push b/.husky/pre-push index 07c67d33..c2162796 100644 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -3,3 +3,4 @@ yarn prettier yarn lint +yarn cypress