From 4bace5804c2ec0366e6ffea42b953fb0b86bedad Mon Sep 17 00:00:00 2001 From: Howard Braham Date: Wed, 18 Dec 2024 02:30:32 +0530 Subject: [PATCH] ${{ env.USE_CACHING }} --- .github/workflows/add-release-label.yml | 2 +- .github/workflows/check-attributions.yml | 2 +- .github/workflows/check-pr-labels.yml | 2 +- .github/workflows/check-template-and-add-labels.yml | 2 +- .github/workflows/close-bug-report.yml | 2 +- .github/workflows/codespaces.yml | 2 +- .github/workflows/fitness-functions.yml | 2 +- .github/workflows/main.yml | 8 +++++--- .github/workflows/run-tests.yml | 12 ++++++++---- .github/workflows/update-attributions.yml | 4 ++-- .github/workflows/update-lavamoat-policies.yml | 6 +++--- 11 files changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/workflows/add-release-label.yml b/.github/workflows/add-release-label.yml index 9fea88eea932..5df833c5cdb5 100644 --- a/.github/workflows/add-release-label.yml +++ b/.github/workflows/add-release-label.yml @@ -20,7 +20,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: Get the next semver version id: get-next-semver-version diff --git a/.github/workflows/check-attributions.yml b/.github/workflows/check-attributions.yml index 4e9e7d173517..3ac72d236cc9 100644 --- a/.github/workflows/check-attributions.yml +++ b/.github/workflows/check-attributions.yml @@ -14,7 +14,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: Check attributions changes run: yarn attributions:check diff --git a/.github/workflows/check-pr-labels.yml b/.github/workflows/check-pr-labels.yml index 7354d16446d0..0207deeca3fd 100644 --- a/.github/workflows/check-pr-labels.yml +++ b/.github/workflows/check-pr-labels.yml @@ -23,7 +23,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: Check PR has required labels env: diff --git a/.github/workflows/check-template-and-add-labels.yml b/.github/workflows/check-template-and-add-labels.yml index f1d0f956b7c1..79eb52c99c96 100644 --- a/.github/workflows/check-template-and-add-labels.yml +++ b/.github/workflows/check-template-and-add-labels.yml @@ -16,7 +16,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: Check template and add labels id: check-template-and-add-labels diff --git a/.github/workflows/close-bug-report.yml b/.github/workflows/close-bug-report.yml index 7f1061968de6..f02c8d4832c9 100644 --- a/.github/workflows/close-bug-report.yml +++ b/.github/workflows/close-bug-report.yml @@ -18,7 +18,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: Close release bug report issue env: diff --git a/.github/workflows/codespaces.yml b/.github/workflows/codespaces.yml index b8bbbcb6d720..f8430e1a3dbc 100644 --- a/.github/workflows/codespaces.yml +++ b/.github/workflows/codespaces.yml @@ -19,4 +19,4 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} diff --git a/.github/workflows/fitness-functions.yml b/.github/workflows/fitness-functions.yml index 9940be65a337..7d71b99bc4d4 100644 --- a/.github/workflows/fitness-functions.yml +++ b/.github/workflows/fitness-functions.yml @@ -19,7 +19,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: Run fitness functions env: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5766d58f0eb4..70ca0346a79a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,8 +40,8 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: false - should-cache-save: $USE_CACHING + should-cache-restore: 'false' + should-cache-save: ${{ env.USE_CACHING }} prep-build-test-webpack: needs: prep-deps @@ -50,7 +50,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} # should add `--env production` to this but need `SEGMENT_PROD_WRITE_KEY` - run: yarn webpack --test --no-lavamoat --no-cache --browser=chrome --lockdown --sentry --snow @@ -65,6 +65,8 @@ jobs: run-tests: needs: prep-deps uses: ./.github/workflows/run-tests.yml + with: + USE_CACHING: ${{ env.USE_CACHING }} run-pageload-benchmark: name: Run Benchmarks # So that the level 1 name will be "Run Benchmarks" in the GitHub Actions UI diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 43e2d0046689..853a7930a1b2 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -2,6 +2,10 @@ name: Run tests on: workflow_call: + inputs: + USE_CACHING: + required: true + type: string outputs: current-coverage: description: Current coverage @@ -21,7 +25,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: test:unit:coverage run: yarn test:unit:coverage --shard=${{ matrix.shard }}/${{ strategy.job-total }} @@ -41,7 +45,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: test:unit:webpack:coverage run: yarn test:unit:webpack:coverage @@ -61,7 +65,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: test:integration:coverage run: yarn test:integration:coverage @@ -88,7 +92,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: Download artifacts uses: actions/download-artifact@v4 diff --git a/.github/workflows/update-attributions.yml b/.github/workflows/update-attributions.yml index 3d0e500d53da..b6bf8af1456f 100644 --- a/.github/workflows/update-attributions.yml +++ b/.github/workflows/update-attributions.yml @@ -61,7 +61,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: Get commit SHA id: commit-sha run: echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" @@ -85,7 +85,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: Generate Attributions run: yarn attributions:generate - name: Cache attributions file diff --git a/.github/workflows/update-lavamoat-policies.yml b/.github/workflows/update-lavamoat-policies.yml index bf9fa7fb14d3..c31f8b2f20ba 100644 --- a/.github/workflows/update-lavamoat-policies.yml +++ b/.github/workflows/update-lavamoat-policies.yml @@ -61,7 +61,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: Get commit SHA id: commit-sha run: echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" @@ -82,7 +82,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: Update LavaMoat build policy run: yarn lavamoat:build:auto - name: Cache build policy @@ -113,7 +113,7 @@ jobs: - name: Setup environment uses: metamask/github-tools/.github/actions/setup-environment@caching with: - should-cache-restore: $USE_CACHING + should-cache-restore: ${{ env.USE_CACHING }} - name: Restore build policy uses: actions/cache/restore@v4 with: