Skip to content

Commit

Permalink
responding to reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
HowardBraham committed Feb 11, 2025
1 parent 3e68fe7 commit cca0088
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 78 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/benchmark-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
workflow_call:

env:
COMMANDS: |
[
'yarn benchmark:chrome --out test-artifacts/chrome/benchmark/pageload.json --retries 2',
'yarn user-actions-benchmark:chrome --out test-artifacts/chrome/benchmark/user_actions.json --retries 2',
]
jobs:
benchmarks:
runs-on: ubuntu-latest
container:
image: cimg/node:22.13-browsers
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@main

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

# Xvfb initializes a virtual "screen" where the browser opens
- name: Configure Xvfb
run: Xvfb -ac :99 -screen 0 1280x1024x16 &

- name: Run the benchmark
# Choose a benchmark command from env.COMMANDS
run: ${{ matrix.testType == 'pageload' && fromJson(env.COMMANDS)[0] || fromJson(env.COMMANDS)[1] }}

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: benchmark-${{ matrix.buildType }}-${{ matrix.testType }}
path: test-artifacts/chrome/benchmark/
retention-days: 30
43 changes: 0 additions & 43 deletions .github/workflows/benchmarks.yml

This file was deleted.

49 changes: 32 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
lint-workflows:
name: Lint workflows
uses: metamask/github-tools/.github/workflows/lint-workflows.yml@benchmarks
uses: metamask/github-tools/.github/workflows/lint-workflows.yml@main

test-lint-shellcheck:
name: Test lint shellcheck
Expand All @@ -29,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@main

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

test-lint-changelog:
name: Test lint changelog
Expand Down Expand Up @@ -67,6 +76,24 @@ 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@main

- run: yarn build:test

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

prep-build-test-webpack:
runs-on: ubuntu-latest
steps:
Expand All @@ -91,21 +118,9 @@ jobs:
name: Run tests
uses: ./.github/workflows/run-tests.yml

run-pageload-benchmark:
name: Run Benchmarks # So that the level 1 name will be "Run Benchmarks" in the GitHub Actions UI
needs: prep-build-test-webpack
uses: ./.github/workflows/benchmarks.yml
with:
name: run-pageload-benchmark # The level 2 name
command: 'yarn benchmark:chrome --out test-artifacts/chrome/benchmark/pageload.json --retries 2'

run-user-actions-benchmark:
name: Run Benchmarks # So that the level 1 name will be "Run Benchmarks" in the GitHub Actions UI
needs: prep-build-test-webpack
uses: ./.github/workflows/benchmarks.yml
with:
name: run-user-actions-benchmark # The level 2 name
command: 'yarn user-actions-benchmark:chrome --out test-artifacts/chrome/benchmark/user_actions.json --retries 2'
run-benchmark-matrix:
uses: ./.github/workflows/benchmark-matrix.yml
needs: [prep-build-test-browserify, prep-build-test-webpack]

wait-for-circleci-workflow-status:
name: Wait for CircleCI workflow status
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/test-circular-deps.yml

This file was deleted.

0 comments on commit cca0088

Please sign in to comment.