From ed6b9eeae84d3689015b41bf75d8d90ca7c450ac Mon Sep 17 00:00:00 2001 From: Jan Prochazka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Mon, 3 Jun 2024 00:10:20 +0200 Subject: [PATCH 1/2] ci(sizes): Sites test between master and 2.x branch --- .github/workflows/publishsizes-2.x.yml | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/publishsizes-2.x.yml diff --git a/.github/workflows/publishsizes-2.x.yml b/.github/workflows/publishsizes-2.x.yml new file mode 100644 index 00000000000..92bce88823d --- /dev/null +++ b/.github/workflows/publishsizes-2.x.yml @@ -0,0 +1,57 @@ +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 + if: | + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' + + 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 From 06969ee179056b3abfdfff15baa83c4400386321 Mon Sep 17 00:00:00 2001 From: Jan Prochazka <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Mon, 3 Jun 2024 00:18:10 +0200 Subject: [PATCH 2/2] ci(sizes): Remove if as its manual trigger --- .github/workflows/publishsizes-2.x.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/publishsizes-2.x.yml b/.github/workflows/publishsizes-2.x.yml index 92bce88823d..9c5583d02ab 100644 --- a/.github/workflows/publishsizes-2.x.yml +++ b/.github/workflows/publishsizes-2.x.yml @@ -13,10 +13,6 @@ jobs: sizes-test-results: name: Sizes Comparsion Results runs-on: ubuntu-latest - if: | - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' - steps: - name: Checkout code uses: actions/checkout@v4 # This step checks out the repository's code at gh-pages branch