Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Testing 29256 #29354

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d46960d
feat: publish-prerelease
itsyoboieltr Dec 16, 2024
2e703a4
fix: artifacts
itsyoboieltr Dec 17, 2024
1479aa6
fix: remove test-deps-audit
itsyoboieltr Dec 17, 2024
4d8eff4
fix: stories
itsyoboieltr Dec 17, 2024
db16e57
Revert "fix: stories"
itsyoboieltr Dec 17, 2024
570887b
Revert "fix: artifacts"
itsyoboieltr Dec 17, 2024
b381dff
feat: get circleci job artifacts
itsyoboieltr Dec 17, 2024
98cc85c
feat: PR_COMMENT_TOKEN
itsyoboieltr Dec 17, 2024
7baed80
feat: reusable workflows
itsyoboieltr Dec 17, 2024
5f70d89
feat: test-yarn-dedupe
itsyoboieltr Dec 17, 2024
8683f67
feat: test-lint-shellcheck
itsyoboieltr Dec 17, 2024
9b0d358
feat: test-deps-depcheck
itsyoboieltr Dec 17, 2024
bfe57ab
feat: test-lint
itsyoboieltr Dec 17, 2024
676d0eb
feat: test-lint-changelog
itsyoboieltr Dec 17, 2024
131caab
feat: test-lint-lockfile
itsyoboieltr Dec 17, 2024
cac38da
feat: trigger-beta-build
itsyoboieltr Dec 17, 2024
e63aba4
Update config.yml
itsyoboieltr Dec 17, 2024
0f45c7d
fix: trigger-beta-build.sh
itsyoboieltr Dec 17, 2024
90cfc5e
Update trigger-beta-build.yml
itsyoboieltr Dec 17, 2024
6d7acbf
Update trigger-beta-build.yml
itsyoboieltr Dec 17, 2024
763a3f8
feat: validate-source-maps-beta
itsyoboieltr Dec 17, 2024
83d541f
Update main.yml
itsyoboieltr Dec 17, 2024
6a64654
fix: trigger-beta-build
itsyoboieltr Dec 18, 2024
56c6763
Version v1.0.0-beta.1
itsyoboieltr Dec 18, 2024
1bd7ac0
Update trigger-beta-build.yml
itsyoboieltr Dec 18, 2024
b99b2cb
test
itsyoboieltr Dec 18, 2024
814f877
Update trigger-beta-build.yml
itsyoboieltr Dec 18, 2024
06e53dd
feat: validate-lavamoat-allow-scripts
itsyoboieltr Dec 18, 2024
0a00295
feat: validate-lavamoat-policy-build
itsyoboieltr Dec 18, 2024
c79d565
feat: validate-lavamoat-policy-webapp
itsyoboieltr Dec 18, 2024
b7077cb
Update trigger-beta-build.yml
itsyoboieltr Dec 18, 2024
474dc8d
feat: build-ts-migration-dashboard
itsyoboieltr Dec 18, 2024
4a6b40c
feat: build-storybook
itsyoboieltr Dec 18, 2024
1abbf88
feat: test-storybook
itsyoboieltr Dec 18, 2024
bfa4bfb
Added lint failures
hjetpoluru Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
348 changes: 0 additions & 348 deletions .circleci/config.yml

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions .circleci/scripts/check-working-tree.sh

This file was deleted.

25 changes: 0 additions & 25 deletions .circleci/scripts/trigger-beta-build.sh

This file was deleted.

22 changes: 0 additions & 22 deletions .circleci/scripts/validate-source-maps-beta.sh

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/build-storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build storybook

on:
workflow_call:

jobs:
build-storybook:
name: Build storybook
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: Build storybook
run: yarn storybook:build

- name: Upload storybook
uses: actions/upload-artifact@v4
with:
name: storybook-build
path: storybook-build

- name: Deploy storybook
if: ${{ (github.head_ref || github.ref_name) == 'main' }}
run: |
git remote add storybook [email protected]:MetaMask/metamask-storybook.git
yarn storybook:deploy
32 changes: 32 additions & 0 deletions .github/workflows/build-ts-migration-dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build ts migration dashboard

on:
workflow_call:

jobs:
build-ts-migration-dashboard:
name: Build ts migration dashboard
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: Build ts migration dashboard
run: yarn ts-migration:dashboard:build

- name: Upload ts migration dashboard
uses: actions/upload-artifact@v4
with:
name: ts-migration-dashboard
path: development/ts-migration-dashboard/build/final

- name: Deploy ts migration dashboard
if: ${{ (github.head_ref || github.ref_name) == 'main' }}
run: |
git remote add ts-migration-dashboard [email protected]:MetaMask/metamask-extension-ts-migration-dashboard.git
git config user.name "MetaMask Bot"
git config user.email [email protected]
yarn ts-migration:dashboard:deploy
99 changes: 86 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,61 @@ on:
merge_group:

jobs:
check-workflows:
name: Check workflows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
lint-workflows:
name: Lint workflows
uses: metamask/github-tools/.github/workflows/lint-workflows.yml@e4fef61e6ec862ab5b1ae63605a88c5e621d20ea

test-deps-audit:
name: Test deps audit
uses: ./.github/workflows/test-deps-audit.yml

test-yarn-dedupe:
name: Test yarn dedupe
uses: ./.github/workflows/test-yarn-dedupe.yml

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

test-deps-depcheck:
name: Test deps depcheck
uses: ./.github/workflows/test-deps-depcheck.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

- name: Download actionlint
id: download-actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash) 1.6.23
shell: bash
validate-lavamoat-allow-scripts:
name: Validate lavamoat allow scripts
uses: ./.github/workflows/validate-lavamoat-allow-scripts.yml

- name: Check workflow files
run: ${{ steps.download-actionlint.outputs.executable }} -color
shell: bash
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

build-ts-migration-dashboard:
name: Build ts migration dashboard
uses: ./.github/workflows/build-ts-migration-dashboard.yml

build-storybook:
name: Build storybook
uses: ./.github/workflows/build-storybook.yml

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

run-tests:
name: Run tests
Expand All @@ -36,13 +77,45 @@ jobs:
name: Wait for CircleCI workflow status
uses: ./.github/workflows/wait-for-circleci-workflow-status.yml

trigger-beta-build:
name: Trigger beta build
if: ${{ (github.head_ref || github.ref_name) != 'master' }}
uses: ./.github/workflows/trigger-beta-build.yml

publish-prerelease:
name: Publish prerelease
if: ${{ github.event_name == 'pull_request' }}
needs:
- wait-for-circleci-workflow-status
- build-ts-migration-dashboard
- build-storybook
- trigger-beta-build
uses: ./.github/workflows/publish-prerelease.yml
secrets:
PR_COMMENT_TOKEN: ${{ secrets.PR_COMMENT_TOKEN }}

all-jobs-completed:
name: All jobs completed
runs-on: ubuntu-latest
needs:
- check-workflows
- lint-workflows
- test-deps-audit
- test-yarn-dedupe
- test-lint-shellcheck
- test-deps-depcheck
- test-lint
- test-lint-changelog
- test-lint-lockfile
- validate-lavamoat-allow-scripts
- validate-lavamoat-policy-build
- validate-lavamoat-policy-webapp
- build-ts-migration-dashboard
- build-storybook
- test-storybook
- run-tests
- wait-for-circleci-workflow-status
- trigger-beta-build
- publish-prerelease
outputs:
PASSED: ${{ steps.set-output.outputs.PASSED }}
steps:
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/publish-prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish prerelease

on:
workflow_call:
secrets:
PR_COMMENT_TOKEN:
required: true

jobs:
publish-prerelease:
name: Publish prerelease
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: Get CircleCI job details
id: get-circleci-job-details
env:
REPOSITORY: ${{ github.repository }}
BRANCH: ${{ github.head_ref }}
run: |
pipeline_id=$(curl --silent "https://circleci.com/api/v2/project/gh/$OWNER/$REPOSITORY/pipeline?branch=$BRANCH" | jq -r ".items[0].id")
workflow_id=$(curl --silent "https://circleci.com/api/v2/pipeline/$pipeline_id/workflow" | jq -r ".items[0].id")
job_details=$(curl --silent "https://circleci.com/api/v2/workflow/$workflow_id/job" | jq -r '.items[] | select(.name == "job-publish-prerelease")')
build_num=$(echo "$job_details" | jq -r '.job_number')
echo 'CIRCLE_BUILD_NUM='"$build_num" >> "$GITHUB_OUTPUT"
job_id=$(echo "$job_details" | jq -r '.id')
echo 'CIRCLE_WORKFLOW_JOB_ID='"$job_id" >> "$GITHUB_OUTPUT"

- name: Get CircleCI job artifacts
env:
CIRCLE_WORKFLOW_JOB_ID: ${{ steps.get-circleci-job-details.outputs.CIRCLE_WORKFLOW_JOB_ID }}
run: |
for platform in chrome firefox; do
pageload=$(curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/${platform}/benchmark/pageload.json")
mkdir -p "test-artifacts/${platform}/benchmark"
echo "${pageload}" > "test-artifacts/${platform}/benchmark/pageload.json"
done

bundle_size=$(curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/chrome/bundle_size.json")
mkdir -p "test-artifacts/chrome"
echo "${bundle_size}" > "test-artifacts/chrome/bundle_size.json"

stories=$(curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/storybook/stories.json")
mkdir "storybook-build"
echo "${stories}" > "storybook-build/stories.json"

- name: Publish prerelease
env:
PR_COMMENT_TOKEN: ${{ secrets.PR_COMMENT_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
HEAD_COMMIT_HASH: ${{ github.event.pull_request.head.sha }}
BASE_COMMIT_HASH: ${{ github.event.pull_request.base.sha }}
CIRCLE_BUILD_NUM: ${{ steps.get-circleci-job-details.outputs.CIRCLE_BUILD_NUM }}
CIRCLE_WORKFLOW_JOB_ID: ${{ steps.get-circleci-job-details.outputs.CIRCLE_WORKFLOW_JOB_ID }}
run: ./development/metamaskbot-build-announce.js
18 changes: 18 additions & 0 deletions .github/workflows/test-deps-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test deps audit

on:
workflow_call:

jobs:
test-deps-audit:
name: Test deps audit
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: Run audit
run: yarn audit
18 changes: 18 additions & 0 deletions .github/workflows/test-deps-depcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test deps depcheck

on:
workflow_call:

jobs:
test-deps-depcheck:
name: Test deps depcheck
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: Run depcheck
run: yarn depcheck
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
Loading
Loading