Skip to content

Commit

Permalink
Cache Bloaty, use PR number (#1771)
Browse files Browse the repository at this point in the history
  • Loading branch information
louwers authored Oct 17, 2023
1 parent b388be7 commit 32be408
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 26 deletions.
58 changes: 32 additions & 26 deletions .github/workflows/ios-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,40 @@ jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
should_skip: steps.changed-files-yaml.outputs.ios_any_changed != 'true'
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
- name: Get all iOS files that have changed
id: changed-files-yaml
uses: tj-actions/changed-files@v39
with:
do_not_skip: '["workflow_dispatch", "push"]'
paths: |
["CMakeLists.txt",
"platform/ios/**",
"platform/darwin/**",
".github/workflows/ios-ci.yml",
"bin/**",
"expression-test/**",
"include/**",
"metrics/**",
"platform/default/**",
"render-test/**",
"scripts/**",
"src/**",
"test/**",
"vendor/**",
".gitmodules",
"!**/*.md",
"WORKSPACE",
"BUILD.bazel",
".bazelrc",
".bazelversion"]
files_yaml: |
ios:
- 'platform/ios/**'
- 'platform/darwin/**'
- '.github/workflows/ios-ci.yml'
- 'bin/**'
- 'expression-test/**'
- 'include/**'
- 'metrics/**'
- 'platform/default/**'
- 'render-test/**'
- 'scripts/**'
- 'src/**'
- 'test/**'
- 'vendor/**'
- '.gitmodules'
- '!**/*.md'
- 'WORKSPACE'
- 'BUILD.bazel'
- '.bazelrc'
- '.bazelversion'
- name: Run step if test file(s) change
if: steps.changed-files-yaml.outputs.ios_any_changed == 'true'
run: |
echo "One or more iOS file(s) has changed."
echo "List of changes: ${{ steps.changed-files-yaml.outputs.ios_all_changed_files }}"
ios-build:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/pr-bloaty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ 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
bloaty_sha: 8be8b448550b37c978e8defd9d421c0464c52cc7

permissions:
pull-requests: write

jobs:
pr-bloaty:
if: github.event.workflow_run.pull_requests.length
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -42,9 +44,16 @@ jobs:
- name: Compile Bloaty
run: |
git clone https://github.com/google/bloaty.git
git checkout "$bloaty_sha"
cmake -B bloaty/build -G Ninja -S bloaty
cmake --build bloaty/build
- name: Cache Bloaty
uses: actions/cache@v3
with:
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"
Expand Down Expand Up @@ -73,5 +82,6 @@ jobs:
- name: Leave a comment with Bloaty results
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ github.event.workflow_run.pull_requests[0].number }}
header: bloaty
path: message.md

0 comments on commit 32be408

Please sign in to comment.