Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

chore: update yarn #353

Merged
merged 15 commits into from
Jan 16, 2024
20 changes: 17 additions & 3 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
24 changes: 19 additions & 5 deletions .github/workflows/main-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
153 changes: 119 additions & 34 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on:
on:
push:
branches:
- master
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions src/setup/setupActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export async function enableEthSign(
export async function acceptTheRisks(
metaMaskPage: DappeteerPage
): Promise<void> {
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(
Expand Down Expand Up @@ -106,9 +108,7 @@ export const closeWhatsNewModal = async (
export const closePrivacyWarningModal = async (
page: DappeteerPage
): Promise<void> => {
await evaluateElementClick(
page,
'[data-testid="snap-privacy-warning-scroll"]'
);
await clickOnButton(page, "snap-privacy-warning-scroll");
await page.waitForTimeout(1000);
await clickOnButton(page, "Accept");
};
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading