Skip to content

Commit

Permalink
[ci] Add sizebot to gh actions
Browse files Browse the repository at this point in the history
ghstack-source-id: 3bbf6e62e8f8ba14b8523d07605d5d289c2f28f3
Pull Request resolved: #30380
  • Loading branch information
poteto committed Jul 18, 2024
1 parent af179ff commit cb5aa83
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/runtime_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -515,3 +515,72 @@ jobs:
- run: ./scripts/circleci/run_devtools_e2e_tests.js
env:
RELEASE_CHANNEL: experimental

# ----- SIZEBOT -----
download_base_build_for_sizebot:
name: Download base build for sizebot
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.20.1
cache: yarn
cache-dependency-path: yarn.lock
- name: Restore cached node_modules
uses: actions/cache@v4
id: node_modules
with:
path: scripts/release/node_modules
key: ${{ runner.arch }}-${{ runner.os }}-scripts-modules-${{ hashFiles('scripts/release/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn install --frozen-lockfile
working-directory: scripts/release
- name: Download artifacts for base revision
run: |
git fetch origin main
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build-ghaction.js --commit=$(git merge-base HEAD origin/main) --allowBrokenCI
mv ./build ./base-build
# TODO: The `download-experimental-build` script copies the npm
# packages into the `node_modules` directory. This is a historical
# quirk of how the release script works. Let's pretend they
# don't exist.
- name: Delete extraneous files
run: rm -rf ./base-build/node_modules
- name: Display structure of build
run: ls -R base-build
- name: Archive base-build
uses: actions/upload-artifact@v4
with:
name: base-build
path: base-build

sizebot:
name: Run sizebot
needs: download_base_build_for_sizebot
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.20.1
cache: yarn
cache-dependency-path: yarn.lock
- name: Restore cached node_modules
uses: actions/cache@v4
id: node_modules
with:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
- name: Restore archived base-build
uses: actions/download-artifact@v4
with:
path: base-build
- run: echo ${{ github.sha }} >> build/COMMIT_SHA
- run: node ./scripts/tasks/danger
- name: Archive sizebot results
uses: actions/upload-artifact@v4
with:
name: sizebot-message
path: sizebot-message.md

0 comments on commit cb5aa83

Please sign in to comment.