diff --git a/.github/workflows/buildWeb.yml b/.github/workflows/buildWeb.yml index 0562ff333e7f..5eef0ed6d1dd 100644 --- a/.github/workflows/buildWeb.yml +++ b/.github/workflows/buildWeb.yml @@ -30,7 +30,7 @@ on: jobs: build: name: Build Web - runs-on: blacksmith-32vcpu-ubuntu-2404 + runs-on: blacksmith-8vcpu-ubuntu-2404 outputs: TAR_FILENAME: webBuild.tar.gz ZIP_FILENAME: webBuild.zip diff --git a/.github/workflows/reassurePerformanceTests.yml b/.github/workflows/reassurePerformanceTests.yml index c3e68b8da619..7a2f7b2f4800 100644 --- a/.github/workflows/reassurePerformanceTests.yml +++ b/.github/workflows/reassurePerformanceTests.yml @@ -7,62 +7,91 @@ on: paths-ignore: [docs/**, help/**, .github/**, contributingGuides/**, tests/**, '**.md', '**.sh'] jobs: - perf-tests: + baseline-perf-tests: + if: ${{ github.actor != 'OSBotify' }} + runs-on: blacksmith-4vcpu-ubuntu-2404 + steps: + - name: Checkout baseline branch + # v1 + uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b + + - name: Checkout baseline branch + shell: bash + run: | + set -e + BASELINE_BRANCH=${BASELINE_BRANCH:="main"} + git fetch origin "$BASELINE_BRANCH" --no-tags + git checkout --force --detach "origin/$BASELINE_BRANCH" --no-recurse-submodules + + - name: Setup NodeJS + uses: ./.github/actions/composite/setupNode + + - name: Run baseline performance tests + shell: bash + run: NODE_OPTIONS=--experimental-vm-modules npx reassure --baseline + + - name: Upload baseline performance results + # v6 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f + with: + name: reassure-baseline-results + path: ./.reassure/baseline.perf + include-hidden-files: true + + branch-perf-tests: if: ${{ github.actor != 'OSBotify' }} runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - name: Checkout + # v1 + uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b + + - name: Setup NodeJS + uses: ./.github/actions/composite/setupNode + + - name: Run branch performance tests + shell: bash + env: + BRANCH: ${{ github.head_ref }} + COMMIT_HASH: ${{ github.event.pull_request.head.sha }} + run: NODE_OPTIONS=--experimental-vm-modules npx reassure --branch="$BRANCH" --commit-hash="$COMMIT_HASH" --no-compare + + - name: Upload branch performance results # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f with: - fetch-depth: 0 + name: reassure-branch-results + path: ./.reassure/current.perf + include-hidden-files: true + + validate-perf-tests: + if: ${{ github.actor != 'OSBotify' }} + runs-on: blacksmith-4vcpu-ubuntu-2404 + needs: [baseline-perf-tests, branch-perf-tests] + steps: + - name: Checkout + # v1 + uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b - name: Setup NodeJS uses: ./.github/actions/composite/setupNode - - name: Set dummy git credentials - run: | - git config --global user.email "test@test.com" - git config --global user.name "Test" + - name: Download baseline performance results + # v7 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 + with: + name: reassure-baseline-results + path: ./.reassure - - name: Get common ancestor commit - run: | - git fetch origin main - common_ancestor=$(git merge-base "${{ github.sha }}" origin/main) - echo "COMMIT_HASH=$common_ancestor" >> "$GITHUB_ENV" + - name: Download branch performance results + # v7 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 + with: + name: reassure-branch-results + path: ./.reassure - - name: Clean up deleted files - run: | - DELETED_FILES=$(git diff --name-only --diff-filter=D "$COMMIT_HASH" "${{ github.sha }}") - for file in $DELETED_FILES; do - if [ -n "$file" ]; then - rm -f "$file" - echo "Deleted file: $file" - fi - done - - name: Capture PR head SHA - if: ${{ github.event_name == 'pull_request' }} - run: echo "PR_SHA=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV" - - - name: Run performance testing script - shell: bash - run: | - set -e - BASELINE_BRANCH=${BASELINE_BRANCH:="main"} - git fetch origin "$BASELINE_BRANCH" --no-tags --depth=1 - - git checkout --force --detach "origin/$BASELINE_BRANCH" --no-recurse-submodules - npm install --force || (rm -rf node_modules && npm install --force) - NODE_OPTIONS=--experimental-vm-modules npx reassure --baseline - - git checkout --force --detach "${PR_SHA:-${GITHUB_SHA}}" --no-recurse-submodules - - if ! git merge --no-commit --allow-unrelated-histories "$BASELINE_BRANCH" -X ours; then - git checkout --ours . - fi - - npm install --force || (rm -rf node_modules && npm install --force) - NODE_OPTIONS=--experimental-vm-modules npx reassure --branch + - name: Compare performance results + run: node -e "require('@callstack/reassure-compare').compare().catch((error) => { console.error(error); process.exit(1); })" - name: Validate output.json id: validateReassureOutput diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 04ae8701a626..433fdd02cc90 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ concurrency: jobs: jest: if: ${{ github.event.head_commit.author.name != 'OSBotify' && github.event.head_commit.author.name != 'imgbot[bot]' || github.event_name == 'workflow_call' }} - runs-on: blacksmith-4vcpu-ubuntu-2404 + runs-on: blacksmith-8vcpu-ubuntu-2404 env: CI: true NODE_OPTIONS: "--experimental-vm-modules --max-old-space-size=8192"