diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index a882a773c..f269e4dfc 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -91,9 +91,23 @@ jobs: CI: 1 run: | cmake --version - CI=1 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 -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 + - 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=MinSizeRel -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMLN_DRAWABLE_RENDERER=ON -DCMAKE_CXX_FLAGS="-Oz -g" + cmake --build build-size --target mbgl-render + + - name: Upload mbgl-render + if: matrix.renderer == 'drawable' + uses: actions/upload-artifact@v3 + with: + name: mbgl-render + path: | + build-size/bin/mbgl-render + - 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 new file mode 100644 index 000000000..f4700da46 --- /dev/null +++ b/.github/workflows/pr-bloaty.yml @@ -0,0 +1,50 @@ + + +name: pr-bloaty + +on: + workflow_run: + workflows: [linux-ci] + types: + - completed +env: + # built with commit d38709084a9865fe0bb8300aec70ebf8243b3d43 + # in the future we should probably use whatever was built last in main + legacy_download_url: https://maplibre-native.s3.eu-central-1.amazonaws.com/mbgl-render + +permissions: + pull-requests: write + +jobs: + pr-bloaty: + runs-on: ubuntu-22.04 + steps: + - uses: ./.github/actions/download-workflow-run-artifact + with: + artifact-name: mbgl-render + expect-files: "mbgl-render" + + - name: Download old mbgl-render + run: | + wget -O mbgl-render-legacy "$legacy_download_url" + + - name: Run Bloaty McBloatface on an ELF file + uses: carlosperate/bloaty-action@v1 + with: + bloaty-args: mbgl-render -- mbgl-render-legacy -n 0 -s vm -d compileunits > tlus_diff.txt + + - name: Prepare Bloaty message + run: | + { + echo "# Bloaty Results 🐋" + echo "" + echo '```' + cat tlus_diff.txt + echo '```' + } >> message.md + + - name: Leave a comment with Bloaty results + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: bloaty + path: message.md