Skip to content

Commit

Permalink
Merge branch 'main' into circles-swaps-util
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmurdoch authored Feb 18, 2025
2 parents 4182372 + 2b39e3b commit d3ddd44
Show file tree
Hide file tree
Showing 38 changed files with 190 additions and 901 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/add-release-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fetch-depth: 0 # This is needed to checkout all branches

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

- name: Get the next semver version
id: get-next-semver-version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Setup environment
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }}
uses: metamask/github-tools/.github/actions/setup-environment@main
uses: metamask/github-tools/.github/actions/setup-environment@1d657e262aea7e3f216754febb624831527d2565

- name: Run beta build
if: ${{ steps.needs-beta-build.outputs.NEEDS_BETA_BUILD == 'true' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Build storybook
run: yarn storybook:build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Check attributions changes
run: yarn attributions:check
2 changes: 1 addition & 1 deletion .github/workflows/check-pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Check PR has required labels
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-template-and-add-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Check template and add labels
id: check-template-and-add-labels
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/close-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Close release bug report issue
env:
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/codespaces.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/fitness-functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fetch-depth: 0 # This is needed to checkout all branches

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

- name: Run fitness functions
env:
Expand Down
58 changes: 56 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
- master
- Version-v*
- trigger-ci*
pull_request:
types:
- opened
Expand All @@ -16,7 +17,7 @@ on:
jobs:
lint-workflows:
name: Lint workflows
uses: metamask/github-tools/.github/workflows/lint-workflows.yml@c534f265e02af2f2422a3c686bb09a11bfbf4cc2
uses: metamask/github-tools/.github/workflows/lint-workflows.yml@1d657e262aea7e3f216754febb624831527d2565

test-lint-shellcheck:
name: Test lint shellcheck
Expand All @@ -28,7 +29,16 @@ jobs:

test-circular-deps:
name: Test circular deps
uses: ./.github/workflows/test-circular-deps.yml
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Check circular dependencies
run: yarn circular-deps:check

test-lint-changelog:
name: Test lint changelog
Expand Down Expand Up @@ -66,10 +76,52 @@ jobs:
name: Validate lavamoat policy webapp
uses: ./.github/workflows/validate-lavamoat-policy-webapp.yml

prep-build-test-browserify:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- run: yarn build:test

- name: Upload artifact prep-build-test-browserify
uses: actions/upload-artifact@v4
with:
name: prep-build-test-browserify
path: ./dist/

prep-build-test-webpack:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- run: yarn webpack --test --no-lavamoat --no-cache --browser=chrome --lockdown --sentry --snow --env production
env:
SEGMENT_PROD_WRITE_KEY: '-' # A fake key just to make the build succeed

- name: Upload artifact prep-build-test-webpack
uses: actions/upload-artifact@v4
with:
name: prep-build-test-webpack
path: ./dist/

run-tests:
name: Run tests
uses: ./.github/workflows/run-tests.yml

run-benchmarks:
uses: ./.github/workflows/run-benchmarks.yml
needs:
- prep-build-test-browserify
- prep-build-test-webpack

wait-for-circleci-workflow-status:
name: Wait for CircleCI workflow status
uses: ./.github/workflows/wait-for-circleci-workflow-status.yml
Expand Down Expand Up @@ -112,6 +164,8 @@ jobs:
secrets:
PR_COMMENT_TOKEN: ${{ secrets.PR_COMMENT_TOKEN }}

# Explanation for all-jobs-completed and all-jobs-pass being separate:
# https://github.com/MetaMask/metamask-module-template/pull/151
all-jobs-completed:
name: All jobs completed
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fetch-depth: 0 # This is needed to get merge base to calculate bundle size diff

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

- name: Get merge base commit hash
id: get-merge-base
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/run-benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
workflow_call:

env:
COMMANDS: |
{
pageload: 'yarn benchmark:chrome --out test-artifacts/chrome/benchmark/pageload.json --retries 2',
userActions: 'yarn user-actions-benchmark:chrome --out test-artifacts/chrome/benchmark/user_actions.json --retries 2',
}
jobs:
benchmarks:
runs-on: ubuntu-22.04
strategy:
matrix:
buildType: [browserify, webpack]
testType: [pageload, userActions]
name: ${{ matrix.buildType }}-${{ matrix.testType }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Download artifact prep-build-test-${{ matrix.buildType }}
uses: actions/download-artifact@v4
with:
path: ./dist/
pattern: prep-build-test-${{ matrix.buildType }}
merge-multiple: true

- name: Run the benchmark
# Choose a benchmark command from env.COMMANDS
run: ${{ fromJson(env.COMMANDS)[matrix.testType] }}

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: benchmark-${{ matrix.buildType }}-${{ matrix.testType }}
path: test-artifacts/chrome/benchmark/
9 changes: 5 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@v4

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

- name: test:unit:coverage
run: yarn test:unit:coverage --shard=${{ matrix.shard }}/${{ strategy.job-total }}
Expand All @@ -43,7 +43,7 @@ jobs:
uses: actions/checkout@v4

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

- name: test:unit:webpack:coverage
run: yarn test:unit:webpack:coverage
Expand All @@ -64,7 +64,7 @@ jobs:
uses: actions/checkout@v4

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

- name: test:integration:coverage
run: yarn test:integration:coverage
Expand Down Expand Up @@ -92,12 +92,13 @@ jobs:
uses: actions/checkout@v4

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

- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: coverage
pattern: coverage-*
merge-multiple: true

- name: Merge coverage reports
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/test-circular-deps.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test-deps-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Run audit
run: yarn audit
2 changes: 1 addition & 1 deletion .github/workflows/test-deps-depcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Run depcheck
run: yarn depcheck
2 changes: 1 addition & 1 deletion .github/workflows/test-lint-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Validate changelog
# For a `pull_request` event, the branch is `github.head_ref``.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-lint-lockfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Lint lockfile
run: yarn lint:lockfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Lint
run: yarn lint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Install Playwright browsers
run: yarn exec playwright install chromium
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-yarn-dedupe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4

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

- name: Detect yarn lock deduplications
run: yarn dedupe --check
6 changes: 3 additions & 3 deletions .github/workflows/update-attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
- name: Setup environment
uses: metamask/github-tools/.github/actions/setup-environment@main
uses: metamask/github-tools/.github/actions/setup-environment@1d657e262aea7e3f216754febb624831527d2565
- name: Get commit SHA
id: commit-sha
run: echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
Expand All @@ -81,7 +81,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
- name: Setup environment
uses: metamask/github-tools/.github/actions/setup-environment@main
uses: metamask/github-tools/.github/actions/setup-environment@1d657e262aea7e3f216754febb624831527d2565
- name: Generate Attributions
run: yarn attributions:generate
- name: Cache attributions file
Expand Down Expand Up @@ -182,4 +182,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.LAVAMOAT_UPDATE_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
ACTION_RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
ACTION_RUN_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
Loading

0 comments on commit d3ddd44

Please sign in to comment.