Skip to content

Commit 6462b00

Browse files
authored
chore: metrics collection job should also run on master (#6882)
The previous PR that introduces the Replay SDK metrics job already contained code that collected baseline info from the main branch. However, after making a change to only run when a specific label is added, this feature got lost... This PR should fix that.
1 parent ea5b1df commit 6462b00

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,8 @@ jobs:
138138
is_develop: ${{ github.ref == 'refs/heads/develop' }}
139139
is_release: ${{ startsWith(github.ref, 'refs/heads/release/') }}
140140
is_gitflow_sync: ${{ github.head_ref == 'refs/heads/develop' || github.head_ref == 'refs/heads/master' }}
141-
has_gitflow_label:
142-
${{ github.event_name == 'pull_request' && contains(steps.pr-labels.outputs.labels, ' Gitflow ') }}
143-
force_skip_cache:
144-
${{ github.event_name == 'pull_request' && contains(steps.pr-labels.outputs.labels, ' ci-skip-cache ') }}
141+
has_gitflow_label: ${{ github.event_name == 'pull_request' && contains(steps.pr-labels.outputs.labels, ' Gitflow ') }}
142+
force_skip_cache: ${{ github.event_name == 'pull_request' && contains(steps.pr-labels.outputs.labels, ' ci-skip-cache ') }}
145143

146144
job_install_deps:
147145
name: Install Dependencies
@@ -174,8 +172,7 @@ jobs:
174172
key: ${{ steps.compute_lockfile_hash.outputs.hash }}
175173

176174
- name: Install dependencies
177-
if:
178-
steps.cache_dependencies.outputs.cache-hit == '' || needs.job_get_metadata.outputs.force_skip_cache == 'true'
175+
if: steps.cache_dependencies.outputs.cache-hit == '' || needs.job_get_metadata.outputs.force_skip_cache == 'true'
179176
run: yarn install --ignore-engines --frozen-lockfile
180177
outputs:
181178
dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }}
@@ -218,8 +215,7 @@ jobs:
218215
path: node_modules/.cache/nx
219216
key: nx-Linux-${{ github.ref }}-${{ env.HEAD_COMMIT }}
220217
# On develop branch, we want to _store_ the cache (so it can be used by other branches), but never _restore_ from it
221-
restore-keys:
222-
${{needs.job_get_metadata.outputs.is_develop == 'false' && env.NX_CACHE_RESTORE_KEYS || 'nx-never-restore'}}
218+
restore-keys: ${{needs.job_get_metadata.outputs.is_develop == 'false' && env.NX_CACHE_RESTORE_KEYS || 'nx-never-restore'}}
223219

224220
- name: Build packages
225221
# Under normal circumstances, using the git SHA as a cache key, there shouldn't ever be a cache hit on the built
@@ -802,7 +798,7 @@ jobs:
802798
needs: [job_get_metadata, job_build]
803799
runs-on: ubuntu-20.04
804800
timeout-minutes: 30
805-
if: contains(github.event.pull_request.labels.*.name, 'ci-overhead-measurements')
801+
if: contains(github.event.pull_request.labels.*.name, 'ci-overhead-measurements') || needs.job_get_metadata.outputs.is_develop == 'true'
806802
steps:
807803
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
808804
uses: actions/checkout@v3

0 commit comments

Comments
 (0)