From ad940fbef537ba294aa2650367f8abbdbd93b3af Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sat, 30 Apr 2022 21:19:42 -0500 Subject: Turn on caching for windows --- .github/workflows/builds.yml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to '.github/workflows/builds.yml') diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index acd92eb48..8bde362a8 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -139,14 +139,14 @@ jobs: env: cache-name: cache-electron-modules with: - key: ${{ runner.os }}-${{ env.cache-name }} + key: ${{ runner.os }}-${{ env.cache-name }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('./package-lock.json') }} path: ${{ env.ELECTRON_CACHE }} - name: Cache electron-builder modules uses: actions/cache@v3 env: cache-name: cache-electron-builder-modules with: - key: ${{ runner.os }}-${{ env.cache-name }} + key: ${{ runner.os }}-${{ env.cache-name }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('./package-lock.json') }} path: ${{ env.ELECTRON_BUILDER_CACHE }} - name: Use Node.js specified in the '.nvmrc' file uses: actions/setup-node@v3 @@ -230,14 +230,14 @@ jobs: env: cache-name: cache-electron-modules with: - key: ${{ runner.os }}-${{ env.cache-name }} + key: ${{ runner.os }}-${{ env.cache-name }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('./package-lock.json') }} path: ${{ env.ELECTRON_CACHE }} - name: Cache electron-builder modules uses: actions/cache@v3 env: cache-name: cache-electron-builder-modules with: - key: ${{ runner.os }}-${{ env.cache-name }} + key: ${{ runner.os }}-${{ env.cache-name }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('./package-lock.json') }} path: ${{ env.ELECTRON_BUILDER_CACHE }} - name: Use Node.js specified in the '.nvmrc' file uses: actions/setup-node@v3 @@ -317,6 +317,10 @@ jobs: - name: Set env vars run: | echo "HOME=$USERPROFILE" >> $GITHUB_ENV + echo "NPM_CACHE=$USERPROFILE/.npm" >> $GITHUB_ENV + echo "PNPM_CACHE=$USERPROFILE/.pnpm-store" >> $GITHUB_ENV + echo "ELECTRON_CACHE=$USERPROFILE/.cache/electron" >> $GITHUB_ENV + echo "ELECTRON_BUILDER_CACHE=$USERPROFILE/.cache/electron-builder" >> $GITHUB_ENV echo "MANUAL_REBUILD_ON_NIGHTLY=${{ github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]') }}" >> $GITHUB_ENV shell: bash - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' or this is a forced rebuild on the nightly branch @@ -335,6 +339,20 @@ jobs: - name: Extract Git branch name from the currently checked out branch (not from the branch where this run was kicked off) run: echo "GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV shell: bash + - name: Cache electron modules + uses: actions/cache@v3 + env: + cache-name: cache-electron-modules + with: + key: ${{ runner.os }}-${{ env.cache-name }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('./package-lock.json') }} + path: ${{ env.ELECTRON_CACHE }} + - name: Cache electron-builder modules + uses: actions/cache@v3 + env: + cache-name: cache-electron-builder-modules + with: + key: ${{ runner.os }}-${{ env.cache-name }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('./package-lock.json') }} + path: ${{ env.ELECTRON_BUILDER_CACHE }} - name: Use Node.js specified in the '.nvmrc' file uses: actions/setup-node@v3 with: -- cgit v1.2.3-70-g09d2