From 63b3f1329ac504f6a5bd0839e8e12ce03002f288 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Tue, 4 Jan 2022 14:57:12 +0100 Subject: [PATCH 1/4] fix: use base hash for cache Otherwise master doesn't build for release --- .github/workflows/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3c7355f6..4ae790fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: ./node_modules ./packages/*/dist ./packages/*/node_modules - key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }} + key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }} - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -60,7 +60,7 @@ jobs: ./node_modules ./packages/*/dist ./packages/*/node_modules - key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }} + key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }} - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -88,7 +88,7 @@ jobs: ./node_modules ./packages/*/dist ./packages/*/node_modules - key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }} + key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }} - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -115,7 +115,7 @@ jobs: ./node_modules ./packages/*/dist ./packages/*/node_modules - key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }} + key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }} - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -142,7 +142,7 @@ jobs: ./node_modules ./packages/*/dist ./packages/*/node_modules - key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }} + key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }} - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -168,7 +168,7 @@ jobs: # ./node_modules # ./packages/*/node_modules # ./packages/*/dist - # key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }} + # key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }} # - name: Install Dependencies # if: steps.cache.outputs.cache-hit != 'true' # run: | @@ -198,7 +198,7 @@ jobs: ./node_modules ./packages/*/dist ./packages/*/node_modules - key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }} + key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }} - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | From 445517e384f988a8f55e5e02dafdbee36ba73880 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Tue, 4 Jan 2022 15:01:48 +0100 Subject: [PATCH 2/4] chore: remove commented build code --- .github/workflows/main.yml | 50 +++++++++++++++++++------------------- package.json | 1 - 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4ae790fd..f4161240 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -150,31 +150,31 @@ jobs: npm run --if-present build - run: npx xvfb-maybe npm run --if-present test:electron-main --bail - # test-electron-renderer: - # needs: check - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - uses: actions/setup-node@v2 - # with: - # node-version: lts/* - # - uses: actions/cache@v2 - # id: cache - # env: - # CACHE_NAME: cache-node-modules - # with: - # path: | - # ~/.npm - # ./node_modules - # ./packages/*/node_modules - # ./packages/*/dist - # key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }} - # - name: Install Dependencies - # if: steps.cache.outputs.cache-hit != 'true' - # run: | - # npm run --if-present build - # npm install - # - run: npx xvfb-maybe npm run --if-present test:electron-renderer --bail + test-electron-renderer: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: lts/* + - uses: actions/cache@v2 + id: cache + env: + CACHE_NAME: cache-node-modules + with: + path: | + ~/.npm + ./node_modules + ./packages/*/node_modules + ./packages/*/dist + key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }} + - name: Install Dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: | + npm run --if-present build + npm install + - run: npx xvfb-maybe npm run --if-present test:electron-renderer --bail release: needs: [test-node, test-chrome, test-firefox, test-electron-main] diff --git a/package.json b/package.json index f48e8518..eb78cf21 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "test:browser": "aegir test -t browser -f ./dist/test/**/*.js", "test:node": "aegir test -t node -f ./dist/test/**/*.js", "test:electron-main": "aegir test -t electron-main -f ./dist/test/**/*.js", - "test:electron-renderer": "aegir test -t electron-renderer -f ./dist/test/**/*.js", "lint": "aegir ts -p check && aegir lint", "build": "tsc", "dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js", From b6de1dd51889d86791096c52a0f3583c33b46d28 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Tue, 4 Jan 2022 15:08:02 +0100 Subject: [PATCH 3/4] chore: build after install --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f4161240..517968fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -172,8 +172,8 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - npm run --if-present build npm install + npm run --if-present build - run: npx xvfb-maybe npm run --if-present test:electron-renderer --bail release: From 174a7b8bdb2a7bac763646aab8bb0c103587ce9e Mon Sep 17 00:00:00 2001 From: achingbrain Date: Tue, 4 Jan 2022 15:10:17 +0100 Subject: [PATCH 4/4] chore: restore dist --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 517968fd..2b622f0d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -165,9 +165,10 @@ jobs: with: path: | ~/.npm + ./dist ./node_modules - ./packages/*/node_modules ./packages/*/dist + ./packages/*/node_modules key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.sha }} - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true'