diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml
index 138ac53661f..74f8d90e285 100644
--- a/.github/workflows/linux-ci.yml
+++ b/.github/workflows/linux-ci.yml
@@ -90,20 +90,36 @@ jobs:
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Debug -DMLN_WITH_CLANG_TIDY=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMLN_WITH_COVERAGE=ON ${{ env.renderer_flag_cmake }}
cmake --build build --target mbgl-core mbgl-test-runner mbgl-render-test-runner mbgl-expression-test
+ # mbgl-render (used for size test)
+
- name: Build mbgl-render
if: matrix.renderer == 'drawable'
run: |
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -B build-size -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMLN_DRAWABLE_RENDERER=ON
cmake --build build-size --target mbgl-render
- - name: Upload mbgl-render
- if: matrix.renderer == 'drawable'
+ - name: Upload mbgl-render as artifact
+ if: matrix.renderer == 'drawable' && github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
with:
name: mbgl-render
path: |
build-size/bin/mbgl-render
+ - name: Configure AWS Credentials
+ if: github.ref == 'refs/heads/main' && vars.OIDC_AWS_ROLE_TO_ASSUME
+ uses: aws-actions/configure-aws-credentials@v4
+ with:
+ aws-region: us-west-2
+ role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
+ role-session-name: ${{ github.run_id }}
+
+ - name: Upload mbgl-render to S3
+ if: github.ref == 'refs/heads/main' && vars.OIDC_AWS_ROLE_TO_ASSUME
+ run: aws s3 cp build-size/bin/mbgl-render s3://maplibre-native/mbgl-render-main
+
+ # CodeQL
+
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
diff --git a/.github/workflows/pr-bloaty.yml b/.github/workflows/pr-bloaty.yml
index 5e36e84b233..98e32b8c789 100644
--- a/.github/workflows/pr-bloaty.yml
+++ b/.github/workflows/pr-bloaty.yml
@@ -8,9 +8,8 @@ on:
types:
- completed
env:
- # built with commit d38709084a9865fe0bb8300aec70ebf8243b3d43
- legacy_download_url: https://maplibre-native.s3.eu-central-1.amazonaws.com/mbgl-render-legacy
- main_download_url: https://maplibre-native.s3.eu-central-1.amazonaws.com/mbgl-render-main
+ download_url: https://maplibre-native.s3.eu-central-1.amazonaws.com
+ legacy_maplibre_sha: d38709084a9865fe0bb8300aec70ebf8243b3d43
bloaty_sha: 8be8b448550b37c978e8defd9d421c0464c52cc7
permissions:
@@ -30,10 +29,13 @@ jobs:
artifact-name: mbgl-render
expect-files: "mbgl-render"
- - name: Download legacy and main mbgl-render
- run: |
- wget -O mbgl-render-legacy "$legacy_download_url"
- wget -O mbgl-render-main "$main_download_url"
+ - name: Download mbgl-render-main
+ run: wget -O mbgl-render-main "${download_url}/mbgl-render-main"
+
+ - name: Download mbgl-render-legacy
+ id: download-mbgl-render-legacy
+ run: wget -O mbgl-render-legacy "${download_url}/mbgl-render-${legacy_maplibre_sha}"
+ continue-on-error: true
- name: Get latest CMake and Ninja
uses: lukka/get-cmake@latest
@@ -57,30 +59,49 @@ jobs:
path: bloaty/build/bloaty
key: bloaty-${{ env.bloaty_sha }}
- - name: Download legacy and main mbgl-render
- run: |
- wget -O mbgl-render-legacy "$legacy_download_url"
- wget -O mbgl-render-main "$main_download_url"
+ - name: Run Bloaty McBloatface on main
+ run: bloaty/build/bloaty mbgl-render -- mbgl-render-main -n 0 -s vm -d compileunits > tlus_diff_main.txt
- name: Run Bloaty McBloatface on legacy
+ if: steps.download-mbgl-render-legacy.outcome == 'success'
run: bloaty/build/bloaty mbgl-render -- mbgl-render-legacy -n 0 -s vm -d compileunits > tlus_diff_legacy.txt
- - name: Run Bloaty McBloatface on main
- run: bloaty/build/bloaty mbgl-render -- mbgl-render-main -n 0 -s vm -d compileunits > tlus_diff_main.txt
+ - name: Configure AWS Credentials
+ if: github.ref == 'refs/heads/main' && vars.OIDC_AWS_ROLE_TO_ASSUME
+ uses: aws-actions/configure-aws-credentials@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
+ - name: Prepare Bloaty message (main)
run: |
+ report_path=bloaty-results/pr-${{ steps.get-pr-number.outputs.pr-number }}-compared-to-main.txt
+ aws s3 cp tlus_diff_main.txt s3://maplibre-native/"$report_path"
{
echo "# Bloaty Results 🐋"
- echo 'Compared to d38709084a9865fe0bb8300aec70ebf8243b3d43
'
+ echo 'Compared to main'
+ echo '```'
+ awk 'NR <= 2; END { print }' tlus_diff_main.txt
+ echo '```'
+ echo "Full report: $gist_url"
+ } >> message.md
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Prepare Bloaty message (legacy)
+ run: |
+ report_path=bloaty-results/pr-${{ steps.get-pr-number.outputs.pr-number }}-compared-to-legacy.txt
+ aws s3 cp tlus_diff_legacy.txt s3://maplibre-native/"$report_path"
+ {
+ echo "Compared to $legacy_maplibre_sha"
echo '```'
- cat tlus_diff_legacy.txt
- echo '``` '
- echo 'Compared to main
'
+ awk 'NR <= 2; END { print }' tlus_diff_legacy.txt
echo '```'
- cat tlus_diff_main.txt
- echo '``` '
+ echo "Full report: $download_url/$report_path"
} >> message.md
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Leave a comment with Bloaty results
uses: marocchino/sticky-pull-request-comment@v2