diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index b52951e0..df75ef75 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -11,15 +11,29 @@ jobs: permissions: issues: write steps: + - name: Activate corepack + run: corepack enable - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - cache: yarn node-version: "16" + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT" + + - name: Cache yarn cache directory + uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install dependencies run: yarn install --frozen-lockfile diff --git a/.github/workflows/main-release.yml b/.github/workflows/main-release.yml index 71b5d03c..802fb021 100644 --- a/.github/workflows/main-release.yml +++ b/.github/workflows/main-release.yml @@ -11,13 +11,27 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'push' && github.ref == 'refs/heads/master' steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - name: Activate corepack + run: corepack enable + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - cache: 'yarn' - node-version: 16 + node-version: "16" registry-url: 'https://registry.npmjs.org' - - run: corepack enable + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT" + + - name: Cache yarn cache directory + uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - run: yarn --immutable - run: yarn build - name: "Retrieving package version" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 410375eb..d1edd8d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ name: CI -on: +on: push: branches: - master @@ -17,12 +17,26 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - name: Activate corepack + run: corepack enable + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: "16" - cache: 'yarn' - - run: corepack enable + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT" + + - name: Cache yarn cache directory + uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install deps run: yarn --immutable - name: Build @@ -32,12 +46,26 @@ jobs: name: 'Download Metamask extension' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - name: Activate corepack + run: corepack enable + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 16 - cache: 'yarn' - - run: corepack enable + node-version: "16" + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT" + + - name: Cache yarn cache directory + uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install deps run: yarn --immutable - name: Download metamask @@ -51,36 +79,64 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - name: Activate corepack + run: corepack enable + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: "16" - cache: 'yarn' - - run: corepack enable + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT" + + - name: Cache yarn cache directory + uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install deps run: yarn --immutable - name: Lint run: yarn run lint tests: - needs: [build, download] + needs: [ build, download ] name: Tests runs-on: ubuntu-latest strategy: fail-fast: false matrix: - mm-version: [mm, flask] - automation: [playwright, puppeteer] + mm-version: [ mm, flask ] + automation: [ playwright, puppeteer ] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - name: Activate corepack + run: corepack enable + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: "16" - cache: 'yarn' + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT" + + - name: Cache yarn cache directory + uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - uses: actions/cache/restore@v3 with: path: ${{env.METAMASK_CACHE_PATH}} key: metamask-extension - - run: corepack enable - name: Install run: yarn --immutable - name: Tests @@ -93,22 +149,36 @@ jobs: tests-user-data: name: Tests UserData runs-on: ubuntu-latest - needs: [tests, download] + needs: [ tests, download ] strategy: fail-fast: false matrix: automation: [ playwright, puppeteer ] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - run: corepack enable + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: "16" - cache: 'yarn' + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT" + + - name: Cache yarn cache directory + uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - uses: actions/cache/restore@v3 with: path: ${{env.METAMASK_CACHE_PATH}} key: metamask-extension - - run: corepack enable + - name: Install run: yarn --immutable - name: Tests UserData @@ -117,7 +187,7 @@ jobs: maybe-release: name: release runs-on: ubuntu-latest - needs: [tests, lint, build, tests-user-data] + needs: [ tests, lint, build, tests-user-data ] if: github.event_name == 'push' && github.ref == 'refs/heads/master' steps: - uses: google-github-actions/release-please-action@v3 # it will analyze commits and create PR with new version and updated CHANGELOG:md file. On merging it will create github release page with changelog @@ -126,21 +196,36 @@ jobs: release-type: node package-name: release-please-action changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":true}]' - - - uses: actions/checkout@v3 + + - uses: actions/checkout@v4 if: ${{ steps.release.outputs.release_created }} - - - uses: actions/setup-node@v3 + + + - name: Activate corepack + run: corepack enable + - uses: actions/setup-node@v4 with: cache: 'yarn' - node-version: 16 + node-version: "16" registry-url: 'https://registry.npmjs.org' if: ${{ steps.release.outputs.release_created }} - - run: corepack enable + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT" + + - name: Cache yarn cache directory + uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - run: yarn --immutable if: ${{ steps.release.outputs.release_created }} - + - run: yarn build if: ${{ steps.release.outputs.release_created }} diff --git a/package.json b/package.json index 2801910f..e0c9e65b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "engines": { "node": ">=16.10" }, - "packageManager": "yarn@3.5.0", + "packageManager": "yarn@3.7.0", "scripts": { "prebuild": "rimraf dist", "build": "tsc -p tsconfig.build.json", diff --git a/src/setup/setupActions.ts b/src/setup/setupActions.ts index b2bb1441..ff26a57b 100644 --- a/src/setup/setupActions.ts +++ b/src/setup/setupActions.ts @@ -44,7 +44,9 @@ export async function enableEthSign( export async function acceptTheRisks( metaMaskPage: DappeteerPage ): Promise { - await clickOnButton(metaMaskPage, "I accept the risks"); + await waitForOverlay(metaMaskPage); + await metaMaskPage.waitForTimeout(300); + await clickOnElement(metaMaskPage, "I accept the risks"); } export async function confirmWelcomeScreen( @@ -106,9 +108,7 @@ export const closeWhatsNewModal = async ( export const closePrivacyWarningModal = async ( page: DappeteerPage ): Promise => { - await evaluateElementClick( - page, - '[data-testid="snap-privacy-warning-scroll"]' - ); + await clickOnButton(page, "snap-privacy-warning-scroll"); + await page.waitForTimeout(1000); await clickOnButton(page, "Accept"); }; diff --git a/yarn.lock b/yarn.lock index d84ae36a..3686a7dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3710,9 +3710,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.30001400": - version: 1.0.30001418 - resolution: "caniuse-lite@npm:1.0.30001418" - checksum: 03380a9ba50b1abd0081e76bfdf331bfb2c28f2277ce5eead5b83960c4db9f1fbbd84a536efa6f8f1fe2c038bc01129d6c42d17f8323fe99a016a5da3829c4bc + version: 1.0.30001576 + resolution: "caniuse-lite@npm:1.0.30001576" + checksum: b8b332675fe703d5e57b02df5f100345f2a3796c537a42422f5bfc82d3256b8bad3f4e2788553656d2650006d13a4b5db99725e2a9462cc0c8035ba494ba1857 languageName: node linkType: hard