Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(profiling): run compile only if bindings have changed #10494

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ jobs:
- *shared
- 'packages/node/**'
- 'packages/profiling-node/**'
profiling_node_bindings:
- 'packages/profiling-node/bindings/**'
deno:
- *shared
- *browser
Expand All @@ -155,6 +157,7 @@ jobs:
changed_remix: ${{ steps.changed.outputs.remix }}
changed_node: ${{ steps.changed.outputs.node }}
changed_profiling_node: ${{ steps.changed.outputs.profiling_node }}
changed_profiling_node_bindings: ${{ steps.changed.outputs.profiling_node_bindings }}
changed_deno: ${{ steps.changed.outputs.deno }}
changed_browser: ${{ steps.changed.outputs.browser }}
changed_browser_integration: ${{ steps.changed.outputs.browser_integration }}
Expand Down Expand Up @@ -976,13 +979,20 @@ jobs:
- name: Build tarballs
run: yarn build:tarball --ignore @sentry/profiling-node

# Rebuild profiling by compiling TS and pulling the precompiled binaries
# Rebuild profiling by compiling TS and pull the precompiled binary artifacts
- name: Build Profiling Node
if: |
(needs.job_get_metadata.outputs.changed_profiling_node_bindings == 'true') ||
(needs.job_get_metadata.outputs.is_release == 'true') ||
(github.event_name != 'pull_request')
run: yarn lerna run build:lib --scope @sentry/profiling-node

- name: Extract Profiling Node Prebuilt Binaries
# @TODO: v4 breaks convenient merging of same name artifacts
# https://github.com/actions/upload-artifact/issues/478
if: |
(needs.job_get_metadata.outputs.changed_profiling_node_bindings == 'true') ||
(github.event_name != 'pull_request')
uses: actions/download-artifact@v3
with:
name: profiling-node-binaries-${{ github.sha }}
Expand Down Expand Up @@ -1086,13 +1096,20 @@ jobs:
env:
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}

# Rebuild profiling by compiling TS and pulling the precompiled binaries
# Rebuild profiling by compiling TS and pull the precompiled binary artifacts
- name: Build Profiling Node
if: |
(needs.job_get_metadata.outputs.changed_profiling_node_bindings == 'true') ||
(needs.job_get_metadata.outputs.is_release == 'true') ||
(github.event_name != 'pull_request')
run: yarn lerna run build:lib --scope @sentry/profiling-node

- name: Extract Profiling Node Prebuilt Binaries
# @TODO: v4 breaks convenient merging of same name artifacts
# https://github.com/actions/upload-artifact/issues/478
if: |
(needs.job_get_metadata.outputs.changed_profiling_node_bindings == 'true') ||
(github.event_name != 'pull_request')
uses: actions/download-artifact@v3
with:
name: profiling-node-binaries-${{ github.sha }}
Expand Down Expand Up @@ -1226,9 +1243,9 @@ jobs:
name: Compile & Test Profiling Bindings (v${{ matrix.node }}) ${{ matrix.target_platform || matrix.os }}, ${{ matrix.node || matrix.container }}, ${{ matrix.arch || matrix.container }}, ${{ contains(matrix.container, 'alpine') && 'musl' || 'glibc' }}
needs: [job_get_metadata, job_install_deps, job_build]
# Compiling bindings can be very slow (especially on windows), so only run precompile
# if profiling or profiling node package had changed or if we are on a release branch.
# Skip precompile unless we are on a release branch as precompile slows down CI times.
if: |
(needs.job_get_metadata.outputs.changed_profiling_node == 'true') ||
(needs.job_get_metadata.outputs.changed_profiling_node_bindings == 'true') ||
(needs.job_get_metadata.outputs.is_release == 'true') ||
(github.event_name != 'pull_request')
runs-on: ${{ matrix.os }}
Expand Down
Loading