Skip to content

Commit

Permalink
Merge branch 'main' into caip25-permission-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
jiexi committed Dec 20, 2024
2 parents 0ab7368 + f64a2d0 commit e749a8a
Show file tree
Hide file tree
Showing 14 changed files with 338 additions and 183 deletions.
142 changes: 0 additions & 142 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ executors:
resource_class: medium+
environment:
NODE_OPTIONS: --max_old_space_size=4096
shellcheck:
docker:
- image: koalaman/shellcheck-alpine@sha256:dfaf08fab58c158549d3be64fb101c626abc5f16f341b569092577ae207db199
resource_class: small
playwright:
docker:
- image: mcr.microsoft.com/playwright:v1.44.1-focal
Expand Down Expand Up @@ -127,18 +123,6 @@ workflows:
- master
requires:
- prep-deps
- validate-lavamoat-allow-scripts:
requires:
- prep-deps
- validate-lavamoat-policy-build:
requires:
- prep-deps
- validate-lavamoat-policy-webapp:
matrix:
parameters:
build-type: [main, beta, flask, mmi]
requires:
- prep-deps
- prep-build-mmi:
requires:
- prep-deps
Expand Down Expand Up @@ -184,16 +168,6 @@ workflows:
- prep-build-ts-migration-dashboard:
requires:
- prep-deps
- test-lint:
requires:
- prep-deps
- test-lint-shellcheck
- test-lint-lockfile:
requires:
- prep-deps
- test-lint-changelog:
requires:
- prep-deps
- test-e2e-chrome-webpack:
<<: *main_master_rc_only
requires:
Expand Down Expand Up @@ -282,13 +256,6 @@ workflows:
- prep-build-flask-mv2
- all-tests-pass:
requires:
- validate-lavamoat-allow-scripts
- validate-lavamoat-policy-build
- validate-lavamoat-policy-webapp
- test-lint
- test-lint-shellcheck
- test-lint-lockfile
- test-lint-changelog
- validate-source-maps
- validate-source-maps-beta
- validate-source-maps-flask
Expand Down Expand Up @@ -499,51 +466,6 @@ jobs:
at: .
- run: yarn tsx .circleci/scripts/validate-locales-only.ts

validate-lavamoat-allow-scripts:
executor: node-browsers-small
steps:
- run: *shallow-git-clone-and-enable-vnc
- run: sudo corepack enable
- attach_workspace:
at: .
- run:
name: Validate allow-scripts config
command: yarn allow-scripts auto
- run:
name: Check working tree
command: .circleci/scripts/check-working-tree.sh

validate-lavamoat-policy-build:
executor: node-browsers-medium
steps:
- run: *shallow-git-clone-and-enable-vnc
- run: sudo corepack enable
- attach_workspace:
at: .
- run:
name: Validate LavaMoat build policy
command: yarn lavamoat:build:auto
- run:
name: Check working tree
command: .circleci/scripts/check-working-tree.sh

validate-lavamoat-policy-webapp:
executor: node-browsers-medium-plus
parameters:
build-type:
type: string
steps:
- run: *shallow-git-clone-and-enable-vnc
- run: sudo corepack enable
- attach_workspace:
at: .
- run:
name: Validate LavaMoat << parameters.build-type >> policy
command: yarn lavamoat:webapp:auto:ci '--build-types=<< parameters.build-type >>'
- run:
name: Check working tree
command: .circleci/scripts/check-working-tree.sh

prep-build:
executor: node-linux-medium
steps:
Expand Down Expand Up @@ -954,20 +876,6 @@ jobs:
name: Rerun workflows from failed
command: yarn ci-rerun-from-failed

test-lint:
executor: node-browsers-medium
steps:
- run: *shallow-git-clone-and-enable-vnc
- run: sudo corepack enable
- attach_workspace:
at: .
- run:
name: Lint
command: yarn lint
- run:
name: Verify locales
command: yarn verify-locales --quiet

test-storybook:
executor: node-browsers-medium-plus
steps:
Expand All @@ -982,56 +890,6 @@ jobs:
name: Test Storybook
command: yarn test-storybook:ci

test-lint-shellcheck:
executor: shellcheck
steps:
- checkout
- run: apk add --no-cache bash jq yarn
- run:
name: ShellCheck Lint
command: ./development/shellcheck.sh

test-lint-lockfile:
executor: node-browsers-medium-plus
steps:
- run: *shallow-git-clone-and-enable-vnc
- run: sudo corepack enable
- attach_workspace:
at: .
- run:
name: lockfile-lint
command: yarn lint:lockfile
- run:
name: check yarn resolutions
command: yarn --check-resolutions

test-lint-changelog:
executor: node-browsers-small
steps:
- run: *shallow-git-clone-and-enable-vnc
- run: sudo corepack enable
- attach_workspace:
at: .
- when:
condition:
not:
matches:
pattern: /^Version-v(\d+)[.](\d+)[.](\d+)$/
value: << pipeline.git.branch >>
steps:
- run:
name: Validate changelog
command: yarn lint:changelog
- when:
condition:
matches:
pattern: /^Version-v(\d+)[.](\d+)[.](\d+)$/
value: << pipeline.git.branch >>
steps:
- run:
name: Validate release candidate changelog
command: .circleci/scripts/validate-changelog-in-rc.sh

test-e2e-chrome-webpack:
executor: node-browsers-medium-plus
parallelism: 20
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ jobs:
run: ${{ steps.download-actionlint.outputs.executable }} -color
shell: bash

test-lint-shellcheck:
name: Test lint shellcheck
uses: ./.github/workflows/test-lint-shellcheck.yml

test-lint:
name: Test lint
uses: ./.github/workflows/test-lint.yml

test-lint-changelog:
name: Test lint changelog
uses: ./.github/workflows/test-lint-changelog.yml

test-lint-lockfile:
name: Test lint lockfile
uses: ./.github/workflows/test-lint-lockfile.yml

test-deps-audit:
name: Test deps audit
uses: ./.github/workflows/test-deps-audit.yml
Expand All @@ -40,6 +56,18 @@ jobs:
name: Test deps depcheck
uses: ./.github/workflows/test-deps-depcheck.yml

validate-lavamoat-allow-scripts:
name: Validate lavamoat allow scripts
uses: ./.github/workflows/validate-lavamoat-allow-scripts.yml

validate-lavamoat-policy-build:
name: Validate lavamoat policy build
uses: ./.github/workflows/validate-lavamoat-policy-build.yml

validate-lavamoat-policy-webapp:
name: Validate lavamoat policy webapp
uses: ./.github/workflows/validate-lavamoat-policy-webapp.yml

run-tests:
name: Run tests
uses: ./.github/workflows/run-tests.yml
Expand All @@ -53,8 +81,15 @@ jobs:
runs-on: ubuntu-latest
needs:
- check-workflows
- test-lint-shellcheck
- test-lint
- test-lint-changelog
- test-lint-lockfile
- test-yarn-dedupe
- test-deps-depcheck
- validate-lavamoat-allow-scripts
- validate-lavamoat-policy-build
- validate-lavamoat-policy-webapp
- run-tests
- wait-for-circleci-workflow-status
outputs:
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/test-lint-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test lint changelog

on:
workflow_call:

jobs:
test-lint-changelog:
name: Test lint changelog
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup environment
uses: metamask/github-tools/.github/actions/setup-environment@main

- name: Validate changelog
if: ${{ !startsWith(github.head_ref || github.ref_name, 'Version-v') }}
run: yarn lint:changelog

- name: Validate release candidate changelog
if: ${{ startsWith(github.head_ref || github.ref_name, 'Version-v') }}
run: .circleci/scripts/validate-changelog-in-rc.sh
21 changes: 21 additions & 0 deletions .github/workflows/test-lint-lockfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test lint lockfile

on:
workflow_call:

jobs:
test-lint-lockfile:
name: Test lint lockfile
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup environment
uses: metamask/github-tools/.github/actions/setup-environment@main

- name: Lint lockfile
run: yarn lint:lockfile

- name: Check yarn resolutions
run: yarn --check-resolutions
15 changes: 15 additions & 0 deletions .github/workflows/test-lint-shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Test lint shellcheck

on:
workflow_call:

jobs:
test-lint-shellcheck:
name: Test lint shellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: ShellCheck Lint
run: ./development/shellcheck.sh
21 changes: 21 additions & 0 deletions .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test lint

on:
workflow_call:

jobs:
test-lint:
name: Test lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup environment
uses: metamask/github-tools/.github/actions/setup-environment@main

- name: Lint
run: yarn lint

- name: Verify locales
run: yarn verify-locales --quiet
25 changes: 25 additions & 0 deletions .github/workflows/validate-lavamoat-allow-scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Validate lavamoat allow scripts

on:
workflow_call:

jobs:
validate-lavamoat-allow-scripts:
name: Validate lavamoat allow scripts
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup environment
uses: metamask/github-tools/.github/actions/setup-environment@main

- name: Validate allow-scripts config
run: yarn allow-scripts auto

- name: Check working tree
run: |
if ! git diff --exit-code; then
echo "::error::Working tree dirty."
exit 1
fi
27 changes: 27 additions & 0 deletions .github/workflows/validate-lavamoat-policy-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Validate lavamoat policy build

on:
workflow_call:

jobs:
validate-lavamoat-policy-build:
name: Validate lavamoat policy build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup environment
uses: metamask/github-tools/.github/actions/setup-environment@main

- name: Validate lavamoat build policy
run: yarn lavamoat:build:auto
env:
INFURA_PROJECT_ID: 00000000000

- name: Check working tree
run: |
if ! git diff --exit-code; then
echo "::error::Working tree dirty."
exit 1
fi
Loading

0 comments on commit e749a8a

Please sign in to comment.