From 95ccff29aedbe68f8d77630179d02aa81aaa9350 Mon Sep 17 00:00:00 2001 From: JonasBa Date: Mon, 5 Feb 2024 10:09:23 -0500 Subject: [PATCH 1/2] ci(profiling): run compile only if bindings have changed --- .github/workflows/build.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f151f9ec33b1..bf1d638dcb25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -137,6 +137,8 @@ jobs: - *shared - 'packages/node/**' - 'packages/profiling-node/**' + profiling_node_bindings: + - 'packages/profiling-node/bindings/**' deno: - *shared - *browser @@ -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 }} @@ -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 arficats - 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 }} @@ -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 arficats - 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 }} @@ -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 }} From 9f062bff7c76d69b9b3076d1ec3ddfcf1de46f79 Mon Sep 17 00:00:00 2001 From: JonasBa Date: Mon, 5 Feb 2024 10:10:50 -0500 Subject: [PATCH 2/2] fix typo --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf1d638dcb25..b8977d691322 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -979,7 +979,7 @@ jobs: - name: Build tarballs run: yarn build:tarball --ignore @sentry/profiling-node - # Rebuild profiling by compiling TS and pull the precompiled binary arficats + # 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') || @@ -1096,7 +1096,7 @@ jobs: env: DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }} - # Rebuild profiling by compiling TS and pull the precompiled binary arficats + # 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') ||