From 5bffd912df3f85820674c7867a67ca32e6a818ca Mon Sep 17 00:00:00 2001 From: Timothy Lai Date: Thu, 24 Jun 2021 14:53:18 -0700 Subject: [PATCH 1/4] chore(ga): cache cypress binary --- .github/workflows/nodejs.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index cf48f438bb8..eed9885c41c 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -29,6 +29,12 @@ jobs: with: path: node_modules key: node-modules-${{ hashFiles('package-lock.json') }} + - name: Cache Cypress binary + id: cache-cypress-binary + uses: actions/cache@v2 + with: + path: cypress/cache + key: cypress-binary-${{ hashFiles('package-lock.json') }} - name: Install dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' run: npm ci From 977326059d62a661cc88b84edde03611ce5446f7 Mon Sep 17 00:00:00 2001 From: Timothy Lai Date: Thu, 24 Jun 2021 15:12:11 -0700 Subject: [PATCH 2/4] chore(ga): add cypress_cache_folder --- .github/workflows/nodejs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index eed9885c41c..cef482ef544 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -9,6 +9,9 @@ on: pull_request: branches: [ master ] +env: + CYPRESS_CACHE_FOLDER: cypress/cache + jobs: build: runs-on: ubuntu-latest From 9cfb1e637a3e7ba02632d79b88ce74a512b25ca7 Mon Sep 17 00:00:00 2001 From: Timothy Lai Date: Thu, 24 Jun 2021 15:26:07 -0700 Subject: [PATCH 3/4] chore(ga): multiline conditional --- .github/workflows/nodejs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index cef482ef544..d701e7cb95b 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -39,7 +39,9 @@ jobs: path: cypress/cache key: cypress-binary-${{ hashFiles('package-lock.json') }} - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' + if: | + steps.cache-node-modules.outputs.cache-hit != 'true' || + steps.cache-cypress-binary.outputs.cache-hit != 'true' run: npm ci - name: Lint code for errors only run: npm run lint-errors From d9e66e56b9aa090f96bb2d89dc5f5fd807144a9c Mon Sep 17 00:00:00 2001 From: Timothy Lai Date: Thu, 24 Jun 2021 15:47:05 -0700 Subject: [PATCH 4/4] chore(ga): add cache node modules to artifact-bundle --- .github/workflows/nodejs.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index d701e7cb95b..2dad6682c53 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -63,7 +63,14 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} + - name: Cache Node Modules # artifact-bundle test is node-only, no Cypress + id: cache-node-modules + uses: actions/cache@v2 + with: + path: node_modules + key: node-modules-${{ hashFiles('package-lock.json') }} - name: Install dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' run: npm ci - name: Build and Run all artifact tests run: npm run test:artifact