From b62897fc3adb287aaff506a0b6e506199566c112 Mon Sep 17 00:00:00 2001 From: Benjamin Smith Date: Mon, 14 Oct 2024 23:07:04 +0200 Subject: [PATCH 1/3] Only Save Cache if Different --- .github/workflows/e2e.yaml | 13 ++++++++++++- .github/workflows/pull-request.yaml | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 8550ece..96c096e 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -26,9 +26,20 @@ jobs: ${{ runner.os }}-yarn- - name: E2E Test - run: yarn && yarn test e2e + run: | + yarn --frozen-lockfile + yarn test e2e env: MPC_CONTRACT_ID: v1.signer-prod.testnet NEAR_ACCOUNT_ID: ${{secrets.NEAR_ACCOUNT_ID}} NEAR_ACCOUNT_PRIVATE_KEY: ${{secrets.NEAR_PK}} ETH_PK: ${{secrets.ETH_PK}} + + - name: Save Cache (Only if no match was found) + if: steps.yarn-cache.outputs.cache-hit != 'true' + uses: actions/cache@v3 + with: + path: | + node_modules + ~/.cache/yarn + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 57bf318..d1e73e4 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -28,8 +28,17 @@ jobs: ${{ runner.os }}-yarn- - name: Install & Build - run: yarn && yarn build - - - name: Lint & Unit Test & Coverage run: | + yarn --frozen-lockfile + yarn lint + yarn build yarn verify + + - name: Save Cache (Only if no match was found) + if: steps.yarn-cache.outputs.cache-hit != 'true' + uses: actions/cache@v4 + with: + path: | + node_modules + ~/.cache/yarn + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} From 7b82b3dc3bb7e6983248a82e67c34ac9a8a2db54 Mon Sep 17 00:00:00 2001 From: Benjamin Smith Date: Mon, 14 Oct 2024 23:07:22 +0200 Subject: [PATCH 2/3] use v4 --- .github/workflows/e2e.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 96c096e..fda7577 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -37,7 +37,7 @@ jobs: - name: Save Cache (Only if no match was found) if: steps.yarn-cache.outputs.cache-hit != 'true' - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | node_modules From 59e327f2a4927daeb98666a568a7b3fabf54bb95 Mon Sep 17 00:00:00 2001 From: Benjamin Smith Date: Mon, 14 Oct 2024 23:10:58 +0200 Subject: [PATCH 3/3] no need for special extra step check --- .github/workflows/e2e.yaml | 9 --------- .github/workflows/pull-request.yaml | 9 --------- package.json | 2 +- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index fda7577..505a79e 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -34,12 +34,3 @@ jobs: NEAR_ACCOUNT_ID: ${{secrets.NEAR_ACCOUNT_ID}} NEAR_ACCOUNT_PRIVATE_KEY: ${{secrets.NEAR_PK}} ETH_PK: ${{secrets.ETH_PK}} - - - name: Save Cache (Only if no match was found) - if: steps.yarn-cache.outputs.cache-hit != 'true' - uses: actions/cache@v4 - with: - path: | - node_modules - ~/.cache/yarn - key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index d1e73e4..214ea9a 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -33,12 +33,3 @@ jobs: yarn lint yarn build yarn verify - - - name: Save Cache (Only if no match was found) - if: steps.yarn-cache.outputs.cache-hit != 'true' - uses: actions/cache@v4 - with: - path: | - node_modules - ~/.cache/yarn - key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} diff --git a/package.json b/package.json index 87ddaac..7582261 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "lint": "eslint . --ignore-pattern dist/ && prettier --check **/*.ts", "test": "jest --testTimeout 30000", "coverage": "yarn test --coverage", - "verify": "yarn lint && yarn coverage unit", + "verify": "yarn coverage unit", "fmt": "prettier --write '{src,examples,tests}/**/*.{js,jsx,ts,tsx}' && eslint src/ --fix" }, "engines": {