From 714b85b5857189956b3a839b340e1655b434031e Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:35:02 -0800 Subject: [PATCH] ci: transfer node_modules as a single archive --- .github/workflows/ci-cd.yml | 7 ++++--- .github/workflows/workspace-paper-js.yml | 9 ++++++--- .github/workflows/workspace-scratch-audio.yml | 9 ++++++--- .github/workflows/workspace-scratch-blocks.yml | 9 ++++++--- .github/workflows/workspace-scratch-gui.yml | 9 ++++++--- .github/workflows/workspace-scratch-paint.yml | 9 ++++++--- .github/workflows/workspace-scratch-render.yml | 9 ++++++--- .github/workflows/workspace-scratch-sb1-converter.yml | 9 ++++++--- .github/workflows/workspace-scratch-storage.yml | 9 ++++++--- .github/workflows/workspace-scratch-svg-renderer.yml | 9 ++++++--- .github/workflows/workspace-scratch-vm.yml | 9 ++++++--- 11 files changed, 64 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index d5df4a6210..51c96d06f7 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -81,13 +81,14 @@ jobs: env: NODE_ENV: development run: npm ci + - if: ${{ steps.filter.outputs.any-workspace == 'true' }} + run: + tar --zstd -cfv node_modules.tar.zst node_modules workspaces/*/node_modules - if: ${{ steps.filter.outputs.any-workspace == 'true' }} uses: actions/upload-artifact@v3 with: name: node-modules - path: | - node_modules/ - workspaces/*/node_modules/ + path: node_modules.tar.zst retention-days: 1 paper-js: uses: ./.github/workflows/workspace-paper-js.yml diff --git a/.github/workflows/workspace-paper-js.yml b/.github/workflows/workspace-paper-js.yml index dc31bb2586..cbbdfc6c2a 100644 --- a/.github/workflows/workspace-paper-js.yml +++ b/.github/workflows/workspace-paper-js.yml @@ -62,10 +62,13 @@ jobs: path: . - run: ls . workspaces/*/ - name: Install NPM dependencies - env: - NODE_ENV: development working-directory: . - run: if [ ! -d node_modules ]; then npm ci; fi + run: | + if [ -f node_modules.tar.zst ]; then + tar --zstd -xvf node_modules.tar.zst + else + NODE_ENV=development npm ci + fi - name: Build run: npm run build - name: Test diff --git a/.github/workflows/workspace-scratch-audio.yml b/.github/workflows/workspace-scratch-audio.yml index 2bce43f128..fc24d40ca7 100644 --- a/.github/workflows/workspace-scratch-audio.yml +++ b/.github/workflows/workspace-scratch-audio.yml @@ -62,10 +62,13 @@ jobs: path: . - run: ls . workspaces/*/ - name: Install NPM dependencies - env: - NODE_ENV: development working-directory: . - run: if [ ! -d node_modules ]; then npm ci; fi + run: | + if [ -f node_modules.tar.zst ]; then + tar --zstd -xvf node_modules.tar.zst + else + NODE_ENV=development npm ci + fi - name: Build run: npm run build - name: Test diff --git a/.github/workflows/workspace-scratch-blocks.yml b/.github/workflows/workspace-scratch-blocks.yml index 451a980513..73177e3be0 100644 --- a/.github/workflows/workspace-scratch-blocks.yml +++ b/.github/workflows/workspace-scratch-blocks.yml @@ -62,10 +62,13 @@ jobs: path: . - run: ls . workspaces/*/ - name: Install NPM dependencies - env: - NODE_ENV: development working-directory: . - run: if [ ! -d node_modules ]; then npm ci; fi + run: | + if [ -f node_modules.tar.zst ]; then + tar --zstd -xvf node_modules.tar.zst + else + NODE_ENV=development npm ci + fi - name: Build run: npm run build - name: Test diff --git a/.github/workflows/workspace-scratch-gui.yml b/.github/workflows/workspace-scratch-gui.yml index dd6cefef52..ddd75e0d09 100644 --- a/.github/workflows/workspace-scratch-gui.yml +++ b/.github/workflows/workspace-scratch-gui.yml @@ -62,10 +62,13 @@ jobs: path: . - run: ls . workspaces/*/ - name: Install NPM dependencies - env: - NODE_ENV: development working-directory: . - run: if [ ! -d node_modules ]; then npm ci; fi + run: | + if [ -f node_modules.tar.zst ]; then + tar --zstd -xvf node_modules.tar.zst + else + NODE_ENV=development npm ci + fi - name: Build run: npm run build - name: Test diff --git a/.github/workflows/workspace-scratch-paint.yml b/.github/workflows/workspace-scratch-paint.yml index 530180719c..80d64779ef 100644 --- a/.github/workflows/workspace-scratch-paint.yml +++ b/.github/workflows/workspace-scratch-paint.yml @@ -62,10 +62,13 @@ jobs: path: . - run: ls . workspaces/*/ - name: Install NPM dependencies - env: - NODE_ENV: development working-directory: . - run: if [ ! -d node_modules ]; then npm ci; fi + run: | + if [ -f node_modules.tar.zst ]; then + tar --zstd -xvf node_modules.tar.zst + else + NODE_ENV=development npm ci + fi - name: Build run: npm run build - name: Test diff --git a/.github/workflows/workspace-scratch-render.yml b/.github/workflows/workspace-scratch-render.yml index 18831b8b11..2dce82cf5a 100644 --- a/.github/workflows/workspace-scratch-render.yml +++ b/.github/workflows/workspace-scratch-render.yml @@ -62,10 +62,13 @@ jobs: path: . - run: ls . workspaces/*/ - name: Install NPM dependencies - env: - NODE_ENV: development working-directory: . - run: if [ ! -d node_modules ]; then npm ci; fi + run: | + if [ -f node_modules.tar.zst ]; then + tar --zstd -xvf node_modules.tar.zst + else + NODE_ENV=development npm ci + fi - name: Build run: npm run build - name: Test diff --git a/.github/workflows/workspace-scratch-sb1-converter.yml b/.github/workflows/workspace-scratch-sb1-converter.yml index 3882f753b8..26158d0f98 100644 --- a/.github/workflows/workspace-scratch-sb1-converter.yml +++ b/.github/workflows/workspace-scratch-sb1-converter.yml @@ -62,10 +62,13 @@ jobs: path: . - run: ls . workspaces/*/ - name: Install NPM dependencies - env: - NODE_ENV: development working-directory: . - run: if [ ! -d node_modules ]; then npm ci; fi + run: | + if [ -f node_modules.tar.zst ]; then + tar --zstd -xvf node_modules.tar.zst + else + NODE_ENV=development npm ci + fi - name: Build run: npm run build - name: Test diff --git a/.github/workflows/workspace-scratch-storage.yml b/.github/workflows/workspace-scratch-storage.yml index ad2d94366c..e5922f35c6 100644 --- a/.github/workflows/workspace-scratch-storage.yml +++ b/.github/workflows/workspace-scratch-storage.yml @@ -62,10 +62,13 @@ jobs: path: . - run: ls . workspaces/*/ - name: Install NPM dependencies - env: - NODE_ENV: development working-directory: . - run: if [ ! -d node_modules ]; then npm ci; fi + run: | + if [ -f node_modules.tar.zst ]; then + tar --zstd -xvf node_modules.tar.zst + else + NODE_ENV=development npm ci + fi - name: Build run: npm run build - name: Test diff --git a/.github/workflows/workspace-scratch-svg-renderer.yml b/.github/workflows/workspace-scratch-svg-renderer.yml index aa19cca014..d69f7be22c 100644 --- a/.github/workflows/workspace-scratch-svg-renderer.yml +++ b/.github/workflows/workspace-scratch-svg-renderer.yml @@ -62,10 +62,13 @@ jobs: path: . - run: ls . workspaces/*/ - name: Install NPM dependencies - env: - NODE_ENV: development working-directory: . - run: if [ ! -d node_modules ]; then npm ci; fi + run: | + if [ -f node_modules.tar.zst ]; then + tar --zstd -xvf node_modules.tar.zst + else + NODE_ENV=development npm ci + fi - name: Build run: npm run build - name: Test diff --git a/.github/workflows/workspace-scratch-vm.yml b/.github/workflows/workspace-scratch-vm.yml index e381bfa0bf..fe0307df57 100644 --- a/.github/workflows/workspace-scratch-vm.yml +++ b/.github/workflows/workspace-scratch-vm.yml @@ -62,10 +62,13 @@ jobs: path: . - run: ls . workspaces/*/ - name: Install NPM dependencies - env: - NODE_ENV: development working-directory: . - run: if [ ! -d node_modules ]; then npm ci; fi + run: | + if [ -f node_modules.tar.zst ]; then + tar --zstd -xvf node_modules.tar.zst + else + NODE_ENV=development npm ci + fi - name: Build run: npm run build - name: Test