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

ci(sizes): Sites test between master and 2.x branch #9755

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Changes from all commits
Commits
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
53 changes: 53 additions & 0 deletions .github/workflows/publishsizes-2.x.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Sizes Results (master-v2.x)

on:
workflow_dispatch:

env:
# It's convenient to set variables for values used multiple times in the workflow
SKETCHES_REPORTS_PATH: artifacts/sizes-report
RESULT_SIZES_TEST_FILE: SIZES_TEST.md
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

jobs:
sizes-test-results:
name: Sizes Comparsion Results
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4 # This step checks out the repository's code at gh-pages branch
with:
ref: gh-pages

- name: Create folder structure
run: |
mkdir -p artifacts && cd artifacts
mkdir -p sizes-report
mkdir -p sizes-report/master
mkdir -p sizes-report/pr

# master folder is a base for comparison
# pr folder is for comparison with master
- name: Download JSON file
run: |
mv master_cli_compile/*.json artifacts/sizes-report/pr/
mv v2.x_cli_compile/*.json artifacts/sizes-report/master/

- name: Report results
uses: P-R-O-C-H-Y/report-size-deltas@sizes_v2
with:
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
github-token: ${{ env.GITHUB_TOKEN }}
destination-file: ${{ env.RESULT_SIZES_TEST_FILE }}

- name: Append file with action URL
run:
echo "/ [GitHub Action Link](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})" >> ${{ env.RESULT_SIZES_TEST_FILE }}

- name: Push to github repo
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add ${{ env.RESULT_SIZES_TEST_FILE }}
git commit -m "Generated Sizes Results (master-v2.x)"
git push origin HEAD:gh-pages