Skip to content

Commit cf53b90

Browse files
committed
ref: build and test as a single command
1 parent 773b298 commit cf53b90

File tree

3 files changed

+44
-41
lines changed

3 files changed

+44
-41
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ jobs:
9898
any_code:
9999
- '!**/*.md'
100100
101-
102101
- name: Get PR labels
103102
id: pr-labels
104103
uses: mydea/pr-labels-action@fn/bump-node20
@@ -191,12 +190,24 @@ jobs:
191190

192191
outputs:
193192
dependency_cache_key: ${{ steps.install_dependencies.outputs.cache_key }}
194-
changed_node_integration: ${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected, '@sentry-internal/node-integration-tests') }}
195-
changed_remix: ${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected, '@sentry/remix') }}
196-
changed_node: ${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected, '@sentry/node') }}
197-
changed_deno: ${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected, '@sentry/deno') }}
198-
changed_bun: ${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected, '@sentry/bun') }}
199-
changed_browser_integration: ${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected, '@sentry-internal/browser-integration-tests') }}
193+
changed_node_integration:
194+
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
195+
'@sentry-internal/node-integration-tests') }}
196+
changed_remix:
197+
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
198+
'@sentry/remix') }}
199+
changed_node:
200+
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
201+
'@sentry/node') }}
202+
changed_deno:
203+
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
204+
'@sentry/deno') }}
205+
changed_bun:
206+
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
207+
'@sentry/bun') }}
208+
changed_browser_integration:
209+
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
210+
'@sentry-internal/browser-integration-tests') }}
200211
# If you are looking for changed_profiling_node, this is defined in job_get_metadata
201212

202213
job_check_branches:
@@ -529,7 +540,9 @@ jobs:
529540
run: yarn lerna run test --scope @sentry/profiling-node
530541

531542
job_browser_playwright_tests:
532-
name: Playwright ${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}', matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests
543+
name:
544+
Playwright ${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}',
545+
matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests
533546
needs: [job_get_metadata, job_build]
534547
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
535548
runs-on: ubuntu-20.04-large-js
@@ -599,13 +612,17 @@ jobs:
599612
env:
600613
PW_BUNDLE: ${{ matrix.bundle }}
601614
working-directory: dev-packages/browser-integration-tests
602-
run: yarn test:ci${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard && format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
615+
run:
616+
yarn test:ci${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard &&
617+
format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
603618

604619
- name: Upload Playwright Traces
605620
uses: actions/upload-artifact@v4
606621
if: failure()
607622
with:
608-
name: playwright-traces-job_browser_playwright_tests-${{ matrix.bundle}}-${{matrix.project}}-${{matrix.shard || '0'}}
623+
name:
624+
playwright-traces-job_browser_playwright_tests-${{ matrix.bundle}}-${{matrix.project}}-${{matrix.shard ||
625+
'0'}}
609626
path: dev-packages/browser-integration-tests/test-results
610627
overwrite: true
611628
retention-days: 7
@@ -916,7 +933,7 @@ jobs:
916933
'nuxt-3',
917934
'vue-3',
918935
'webpack-4',
919-
'webpack-5'
936+
'webpack-5',
920937
]
921938
build-command:
922939
- false
@@ -1019,9 +1036,8 @@ jobs:
10191036
# We need to add the `always()` check here because the previous step has this as well :(
10201037
# See: https://github.com/actions/runner/issues/2205
10211038
if:
1022-
always() && needs.job_e2e_prepare.result == 'success' &&
1023-
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
1024-
github.actor != 'dependabot[bot]'
1039+
always() && needs.job_e2e_prepare.result == 'success' && (github.event_name != 'pull_request' ||
1040+
github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
10251041
needs: [job_get_metadata, job_build, job_e2e_prepare]
10261042
runs-on: ubuntu-20.04
10271043
timeout-minutes: 10
@@ -1135,12 +1151,10 @@ jobs:
11351151
# See: https://github.com/actions/runner/issues/2205
11361152
if:
11371153
# Only run profiling e2e tests if profiling node bindings have changed
1138-
always() && needs.job_e2e_prepare.result == 'success' &&
1139-
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
1140-
(
1141-
(needs.job_get_metadata.outputs.changed_profiling_node == 'true') ||
1142-
(needs.job_get_metadata.outputs.is_release == 'true')
1143-
)
1154+
always() && needs.job_e2e_prepare.result == 'success' && (github.event_name != 'pull_request' ||
1155+
github.event.pull_request.head.repo.full_name == github.repository) && (
1156+
(needs.job_get_metadata.outputs.changed_profiling_node == 'true') || (needs.job_get_metadata.outputs.is_release ==
1157+
'true') )
11441158
needs: [job_get_metadata, job_build, job_e2e_prepare]
11451159
runs-on: ubuntu-20.04
11461160
timeout-minutes: 10
@@ -1223,16 +1237,6 @@ jobs:
12231237
timeout-minutes: 5
12241238
run: yarn test:assert
12251239

1226-
- name: Build E2E app with shimmed ESM globals
1227-
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1228-
timeout-minutes: 5
1229-
run: yarn ${{ matrix.build-command || 'test:build:shimmed' }}
1230-
1231-
- name: Run E2E test with shimmed ESM globals
1232-
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1233-
timeout-minutes: 5
1234-
run: yarn test:assert:shimmed
1235-
12361240
job_required_jobs_passed:
12371241
name: All required jobs passed or were skipped
12381242
needs:
@@ -1307,7 +1311,10 @@ jobs:
13071311
retention-days: 7
13081312

13091313
job_compile_bindings_profiling_node:
1310-
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' }}
1314+
name:
1315+
Compile & Test Profiling Bindings (v${{ matrix.node }}) ${{ matrix.target_platform || matrix.os }}, ${{
1316+
matrix.node || matrix.container }}, ${{ matrix.arch || matrix.container }}, ${{ contains(matrix.container,
1317+
'alpine') && 'musl' || 'glibc' }}
13111318
needs: [job_get_metadata, job_build]
13121319
# Compiling bindings can be very slow (especially on windows), so only run precompile
13131320
# Skip precompile unless we are on a release branch as precompile slows down CI times.
@@ -1321,7 +1328,7 @@ jobs:
13211328
fail-fast: false
13221329
matrix:
13231330
include:
1324-
# x64 glibc
1331+
# x64 glibc
13251332
- os: ubuntu-20.04
13261333
node: 16
13271334
binary: linux-x64-glibc-93
@@ -1478,7 +1485,7 @@ jobs:
14781485

14791486
- name: Install dependencies
14801487
env:
1481-
SKIP_PLAYWRIGHT_BROWSER_INSTALL: "1"
1488+
SKIP_PLAYWRIGHT_BROWSER_INSTALL: '1'
14821489
if: steps.restore-dependencies.outputs.cache-hit != 'true'
14831490
run: yarn install --ignore-engines --frozen-lockfile
14841491

dev-packages/e2e-tests/test-applications/node-profiling/build.shimmed.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ console.log('Running build using esbuild version', esbuild.version);
1111
esbuild.buildSync({
1212
platform: 'node',
1313
entryPoints: ['./index.ts'],
14-
outfile: './dist/index.mjs',
14+
outfile: './dist/index.shimmed.mjs',
1515
target: 'esnext',
1616
format: 'esm',
1717
bundle: true,

dev-packages/e2e-tests/test-applications/node-profiling/package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44
"private": true,
55
"scripts": {
66
"typecheck": "tsc --noEmit",
7-
"build": "node build.mjs",
8-
"build:shimmed": "node build.shimmed.mjs",
9-
"test": "npm run build && node dist/index.js",
10-
"test:shimmed": "npm run build:shimmed && node dist/index.mjs",
7+
"build": "node build.mjs && npm run build:shimmed",
8+
"test": "node dist/index.js && node dist/index.shimmed.mjs",
119
"clean": "npx rimraf node_modules dist",
1210
"test:build": "npm run typecheck && npm run build",
13-
"test:build:shimmed": "npm run typecheck && npm run build:shimmed",
14-
"test:assert": "npm run test",
15-
"test:assert:shimmed": "npm run test:shimmed"
11+
"test:assert": "npm run test"
1612
},
1713
"dependencies": {
1814
"@sentry/node": "latest || *",

0 commit comments

Comments
 (0)