Skip to content

Commit 9016d2c

Browse files
committed
[bfops/ci-backtrace]: Merge remote-tracking branch 'origin/master' into bfops/ci-backtrace
2 parents 6265720 + 0922704 commit 9016d2c

161 files changed

Lines changed: 10624 additions & 988 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 0 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ jobs:
3636
timeout-minutes: 120
3737
env:
3838
CARGO_TARGET_DIR: ${{ github.workspace }}/target
39-
RUST_BACKTRACE: full
4039
SPACETIMEDB_CPP_DIR: ${{ github.workspace }}/crates/bindings-cpp
4140
steps:
4241
- name: Find Git ref
@@ -183,7 +182,6 @@ jobs:
183182

184183
env:
185184
CARGO_TARGET_DIR: ${{ github.workspace }}/target
186-
RUST_BACKTRACE: full
187185
steps:
188186
- name: Find Git ref
189187
env:
@@ -274,7 +272,6 @@ jobs:
274272
timeout-minutes: 60
275273
env:
276274
CARGO_TARGET_DIR: ${{ github.workspace }}/target
277-
RUST_BACKTRACE: full
278275
steps:
279276
- name: Find Git ref
280277
env:
@@ -330,7 +327,6 @@ jobs:
330327
runs-on: spacetimedb-new-runner-2
331328
env:
332329
CARGO_TARGET_DIR: ${{ github.workspace }}/target
333-
RUST_BACKTRACE: full
334330
steps:
335331
- name: Checkout sources
336332
uses: actions/checkout@v3
@@ -370,7 +366,6 @@ jobs:
370366
runs-on: spacetimedb-new-runner-2
371367
env:
372368
CARGO_TARGET_DIR: ${{ github.workspace }}/target
373-
RUST_BACKTRACE: full
374369
steps:
375370
- uses: actions/checkout@v3
376371

@@ -395,8 +390,6 @@ jobs:
395390
name: Check that packages are publishable
396391
runs-on: spacetimedb-new-runner-2
397392
permissions: read-all
398-
env:
399-
RUST_BACKTRACE: full
400393
steps:
401394
- uses: actions/checkout@v3
402395
- uses: dsherret/rust-toolchain-file@v1
@@ -416,8 +409,6 @@ jobs:
416409
- { target: aarch64-apple-darwin, runner: macos-latest }
417410
- { target: x86_64-pc-windows-msvc, runner: windows-latest }
418411
runs-on: ${{ matrix.runner }}
419-
env:
420-
RUST_BACKTRACE: full
421412
steps:
422413
- name: Checkout
423414
uses: actions/checkout@v3
@@ -462,8 +453,6 @@ jobs:
462453
# Run as root because otherwise we get permission denied for various directories inside the container. I tried doing dances to allow it to run
463454
# without this (reassigning env vars and stuff), but was unable to get it to work and it felt like an uphill battle.
464455
options: --user 0:0
465-
env:
466-
RUST_BACKTRACE: full
467456
steps:
468457
# Uncomment this before merging so that it will run properly if run manually through the GH actions flow. It was playing weird with rolled back
469458
# commits though.
@@ -536,8 +525,6 @@ jobs:
536525
ci_command_docs:
537526
name: Check CI command docs
538527
runs-on: spacetimedb-new-runner-2
539-
env:
540-
RUST_BACKTRACE: full
541528
steps:
542529
- name: Find Git ref
543530
env:
@@ -570,7 +557,6 @@ jobs:
570557
runs-on: spacetimedb-new-runner-2
571558
env:
572559
CARGO_TARGET_DIR: ${{ github.workspace }}/target
573-
RUST_BACKTRACE: full
574560
steps:
575561
- name: Find Git ref
576562
env:
@@ -641,7 +627,6 @@ jobs:
641627
timeout-minutes: 30
642628
env:
643629
CARGO_TARGET_DIR: ${{ github.workspace }}/target
644-
RUST_BACKTRACE: full
645630
steps:
646631
- name: Checkout repository
647632
id: checkout-stdb
@@ -781,7 +766,6 @@ jobs:
781766
timeout-minutes: 30
782767
env:
783768
CARGO_TARGET_DIR: ${{ github.workspace }}/target
784-
RUST_BACKTRACE: full
785769
steps:
786770
- name: Checkout repository
787771
id: checkout-stdb
@@ -894,145 +878,11 @@ jobs:
894878
exit 1
895879
}
896880
897-
internal-tests:
898-
name: Internal Tests
899-
needs: [lints]
900-
# Skip if not a PR or a push to master
901-
# Skip if this is an external contribution. GitHub secrets will be empty, so the step would fail anyway.
902-
if: ${{ (github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/master'))
903-
&& (github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork) }}
904-
permissions:
905-
contents: read
906-
runs-on: ubuntu-latest
907-
env:
908-
RUST_BACKTRACE: full
909-
TARGET_OWNER: clockworklabs
910-
TARGET_REPO: SpacetimeDBPrivate
911-
steps:
912-
- id: dispatch
913-
name: Trigger tests
914-
uses: actions/github-script@v7
915-
with:
916-
github-token: ${{ secrets.SPACETIMEDB_PRIVATE_TOKEN }}
917-
script: |
918-
const workflowId = 'ci.yml';
919-
const targetRef = 'master';
920-
const targetOwner = process.env.TARGET_OWNER;
921-
const targetRepo = process.env.TARGET_REPO;
922-
// Use the ref for pull requests because the head sha is brittle (github does some extra dance where it merges in master).
923-
const publicRef = (context.eventName === 'pull_request') ? context.payload.pull_request.head.ref : context.sha;
924-
const publicPrNumber = context.payload.pull_request?.number ?? context.payload.inputs?.pr_number;
925-
const preDispatch = new Date().toISOString();
926-
const inputs = { public_ref: publicRef };
927-
if (publicPrNumber) {
928-
inputs.public_pr_number = String(publicPrNumber);
929-
}
930-
931-
// Dispatch the workflow in the target repository
932-
await github.rest.actions.createWorkflowDispatch({
933-
owner: targetOwner,
934-
repo: targetRepo,
935-
workflow_id: workflowId,
936-
ref: targetRef,
937-
inputs,
938-
});
939-
940-
const sleep = (ms) => new Promise(r => setTimeout(r, ms));
941-
942-
// Find the dispatched run by name
943-
let runId = null;
944-
for (let attempt = 0; attempt < 20 && !runId; attempt++) { // up to ~10 minutes to locate the run
945-
await sleep(5000);
946-
const runsResp = await github.rest.actions.listWorkflowRuns({
947-
owner: targetOwner,
948-
repo: targetRepo,
949-
workflow_id: workflowId,
950-
event: 'workflow_dispatch',
951-
branch: targetRef,
952-
per_page: 50,
953-
});
954-
955-
const expectedName = `CI [public_ref=${publicRef}]`;
956-
const candidates = runsResp.data.workflow_runs
957-
.filter(r => r.name === expectedName && new Date(r.created_at) >= new Date(preDispatch))
958-
.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
959-
960-
if (candidates.length > 0) {
961-
runId = candidates[0].id;
962-
break;
963-
}
964-
}
965-
966-
if (!runId) {
967-
core.setFailed('Failed to locate dispatched run in the private repository.');
968-
return;
969-
}
970-
971-
const runUrl = `https://github.com/${targetOwner}/${targetRepo}/actions/runs/${runId}`;
972-
core.info(`View run: ${runUrl}`);
973-
core.setOutput('run_id', String(runId));
974-
core.setOutput('run_url', runUrl);
975-
976-
- name: Wait for Internal Tests to complete
977-
uses: actions/github-script@v7
978-
with:
979-
github-token: ${{ secrets.SPACETIMEDB_PRIVATE_TOKEN }}
980-
script: |
981-
const targetOwner = process.env.TARGET_OWNER;
982-
const targetRepo = process.env.TARGET_REPO;
983-
const runId = Number(`${{ steps.dispatch.outputs.run_id }}`);
984-
const runUrl = `${{ steps.dispatch.outputs.run_url }}`;
985-
const sleep = (ms) => new Promise(r => setTimeout(r, ms));
986-
987-
core.info(`Waiting for workflow result... ${runUrl}`);
988-
989-
let conclusion = null;
990-
for (let attempt = 0; attempt < 240; attempt++) { // up to ~2 hours
991-
const runResp = await github.rest.actions.getWorkflowRun({
992-
owner: targetOwner,
993-
repo: targetRepo,
994-
run_id: runId
995-
});
996-
const { status, conclusion: c } = runResp.data;
997-
if (status === 'completed') {
998-
conclusion = c || 'success';
999-
break;
1000-
}
1001-
await sleep(30000);
1002-
}
1003-
1004-
if (!conclusion) {
1005-
core.setFailed('Timed out waiting for private workflow to complete.');
1006-
return;
1007-
}
1008-
1009-
if (conclusion !== 'success') {
1010-
core.setFailed(`Private workflow failed with conclusion: ${conclusion}`);
1011-
}
1012-
1013-
- name: Cancel invoked run if workflow cancelled
1014-
if: ${{ cancelled() }}
1015-
uses: actions/github-script@v7
1016-
with:
1017-
github-token: ${{ secrets.SPACETIMEDB_PRIVATE_TOKEN }}
1018-
script: |
1019-
const targetOwner = process.env.TARGET_OWNER;
1020-
const targetRepo = process.env.TARGET_REPO;
1021-
const runId = Number(`${{ steps.dispatch.outputs.run_id }}`);
1022-
if (!runId) return;
1023-
await github.rest.actions.cancelWorkflowRun({
1024-
owner: targetOwner,
1025-
repo: targetRepo,
1026-
run_id: runId,
1027-
});
1028-
1029881
global_json_policy:
1030882
name: Verify global.json files are symlinks
1031883
runs-on: ubuntu-latest
1032884
permissions:
1033885
contents: read
1034-
env:
1035-
RUST_BACKTRACE: full
1036886
steps:
1037887
- name: Find Git ref
1038888
env:
@@ -1072,7 +922,6 @@ jobs:
1072922
contents: read
1073923
env:
1074924
CARGO_TARGET_DIR: ${{ github.workspace }}/target
1075-
RUST_BACKTRACE: full
1076925
steps:
1077926
- name: Find Git ref
1078927
env:
@@ -1125,8 +974,6 @@ jobs:
1125974
docs-build:
1126975
name: Docs build
1127976
runs-on: spacetimedb-new-runner-2
1128-
env:
1129-
RUST_BACKTRACE: full
1130977
steps:
1131978
- name: Checkout repository
1132979
uses: actions/checkout@v3
@@ -1164,8 +1011,6 @@ jobs:
11641011
typescript-test:
11651012
name: TypeScript - Tests
11661013
runs-on: spacetimedb-new-runner-2
1167-
env:
1168-
RUST_BACKTRACE: full
11691014
steps:
11701015
- name: Checkout repository
11711016
uses: actions/checkout@v4
@@ -1276,8 +1121,6 @@ jobs:
12761121

12771122
version_upgrade_check:
12781123
runs-on: spacetimedb-new-runner-2
1279-
env:
1280-
RUST_BACKTRACE: full
12811124
steps:
12821125
- name: Checkout
12831126
uses: actions/checkout@v3

0 commit comments

Comments
 (0)