Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bart Louwers <bart@emeel.net>
114 lines
3.8 KiB
YAML
114 lines
3.8 KiB
YAML
name: pr-bloaty-ios
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: [ios-ci]
|
|
types:
|
|
- completed
|
|
env:
|
|
download_url: https://maplibre-native.s3.eu-central-1.amazonaws.com
|
|
|
|
permissions:
|
|
pull-requests: write
|
|
id-token: write # This is required for requesting the AWS JWT
|
|
|
|
jobs:
|
|
pre_job:
|
|
if: github.event.workflow_run.event == 'pull_request'
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
should_skip: ${{ steps.parent_workflow.outputs.was_skipped_or_cancelled }}
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
|
|
with:
|
|
sparse-checkout: |
|
|
.github
|
|
.nvmrc
|
|
persist-credentials: false
|
|
|
|
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v4
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
|
|
- run: npm install
|
|
|
|
- name: Get parent workflow result
|
|
id: parent_workflow
|
|
run: node .github/scripts/check-job-skipped.ts
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
TEST_RUN_ID: ${{ github.event.workflow_run.id }}
|
|
JOB_NAME: ios-build
|
|
|
|
pr-bloaty-ios:
|
|
needs: pre_job
|
|
if: needs.pre_job.outputs.should_skip == 'false'
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Cache Bloaty
|
|
id: cache-bloaty
|
|
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
|
with:
|
|
path: bloaty/build/bloaty
|
|
key: bloaty-${{ env.bloaty_sha }}
|
|
|
|
# because Google is not making a release...
|
|
# https://github.com/google/bloaty/issues/334
|
|
- name: Compile Bloaty
|
|
if: ${{ !steps.cache-bloaty.outputs.cache-hit }}
|
|
run: |
|
|
git clone https://github.com/google/bloaty.git
|
|
cd bloaty
|
|
git checkout "$bloaty_sha"
|
|
cmake -B build -G Ninja -S .
|
|
cmake --build build
|
|
|
|
- name: Download MapLibre_dynamic-main, MapLibre_DWARF-main
|
|
run: |
|
|
wget -O MapLibre_dynamic-main "${download_url}/size-test-ios/MapLibre_dynamic-main"
|
|
wget -O MapLibre_DWARF-main "${download_url}/size-test-ios/MapLibre_DWARF-main"
|
|
|
|
- uses: ./.github/actions/get-pr-number
|
|
id: get-pr-number
|
|
|
|
- uses: ./.github/actions/download-workflow-run-artifact
|
|
with:
|
|
artifact-name: ios-size-test-files
|
|
expect-files: "MapLibre_dynamic,MapLibre_DWARF"
|
|
|
|
- name: Run Bloaty
|
|
run: bloaty/build/bloaty --debug-file MapLibre_DWARF --debug-file MapLibre_DWARF-main MapLibre_dynamic -n 0 -s vm -d compileunits -- MapLibre_dynamic-main > bloaty_diff.txt
|
|
|
|
- name: Configure AWS Credentials
|
|
if: vars.OIDC_AWS_ROLE_TO_ASSUME
|
|
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v4
|
|
with:
|
|
aws-region: us-west-2
|
|
role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
|
|
role-session-name: ${{ github.run_id }}
|
|
|
|
- name: Prepare Bloaty message
|
|
run: |
|
|
report_path=bloaty-results-ios/pr-${{ steps.get-pr-number.outputs.pr-number }}-compared-to-main.txt
|
|
aws s3 cp bloaty_diff.txt s3://maplibre-native/"$report_path"
|
|
{
|
|
echo "# Bloaty Results (iOS) 🐋"
|
|
echo 'Compared to main'
|
|
echo '```'
|
|
awk 'NR <= 2; END { print }' bloaty_diff.txt
|
|
echo '```'
|
|
echo "Full report: $download_url/$report_path"
|
|
echo "---"
|
|
} >> message.md
|
|
|
|
- name: Leave a comment with Bloaty results
|
|
uses: marocchino/sticky-pull-request-comment@70d2764d1a7d5d9560b100cbea0077fc8f633987 # v3.0.2
|
|
with:
|
|
number: ${{ steps.get-pr-number.outputs.pr-number }}
|
|
header: bloaty-ios
|
|
path: message.md
|