Skip to content

Commit c2f3dfd

Browse files
committed
ci: add developer workflow tests and fix workspace build order
The prepare script now builds packages in dependency order: 1. utils/esbuild (no deps) 2. common/trace-commands, gh-inputs, pretty-errors (pretty-errors needs trace-commands) 3. utils packages 4. Action packages in dependency order (setup-program first, then dependents) This fixes "Cannot find module" errors on fresh clones where npm was running workspace prepare scripts in parallel without respecting dependencies. Added dev-workflow CI job that tests npm install/build/test on all platforms, blocking the main build matrix if it fails.
1 parent 091785a commit c2f3dfd

File tree

52 files changed

+3517
-3463
lines changed

Some content is hidden

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

52 files changed

+3517
-3463
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,63 @@ env:
2121
DEFAULT_BUILD_VARIANT: debug,release
2222

2323
jobs:
24+
# ===========================================================================
25+
# Developer workflow tests
26+
# Ensures contributors can clone, install, build, and test locally
27+
# ===========================================================================
28+
dev-workflow:
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
os: [ubuntu-latest, windows-latest, macos-latest]
33+
34+
name: Dev Workflow (${{ matrix.os }})
35+
runs-on: ${{ matrix.os }}
36+
timeout-minutes: 15
37+
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
42+
- name: Setup Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: '20'
46+
47+
- name: Install dependencies
48+
run: npm install
49+
50+
- name: Build all workspaces
51+
run: npm run build
52+
53+
- name: Run tests
54+
run: npm test
55+
56+
- name: Check dist bundles
57+
if: matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request'
58+
run: |
59+
# Get files changed in this PR
60+
git fetch origin ${{ github.base_ref }} --depth=1
61+
changed_files=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
62+
63+
# Check for source and dist changes
64+
source_changed=$(echo "$changed_files" | grep -E '\.ts$' || true)
65+
dist_changed=$(echo "$changed_files" | grep -E '/dist/' || true)
66+
67+
if [ -n "$source_changed" ] && [ -z "$dist_changed" ]; then
68+
echo "::warning::Source files changed but no dist/ files were updated. Run 'npm run build' and commit the updated dist/ files."
69+
echo "Changed source files:"
70+
echo "$source_changed"
71+
else
72+
echo "Dist bundle check passed"
73+
fi
74+
75+
# ===========================================================================
76+
# Action integration tests
77+
# Tests the actions in practice with various C++ compilers and platforms
78+
# ===========================================================================
2479
cpp-matrix:
80+
needs: dev-workflow
2581
runs-on: ubuntu-latest
2682
name: Generate Test Matrix
2783
outputs:

b2-workflow/dist/index.js

Lines changed: 43 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

b2-workflow/dist/index.js.map

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

b2-workflow/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
"main": "lib/index.js",
66
"scripts": {
77
"build": "tsc -p .config/tsconfig.json",
8-
"prepare": "npm run build && node ../utils/esbuild/dist/index.js .",
98
"typecheck": "tsc -p .config/tsconfig.json --noEmit",
109
"test": "jest --config ../jest.config.js --selectProjects b2-workflow",
11-
"all": "npm run prepare && npm run test"
10+
"all": "npm run build && node ../utils/esbuild/dist/index.js ."
1211
},
1312
"keywords": [],
1413
"author": "",

boost-clone/dist/index.js

Lines changed: 172 additions & 169 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

boost-clone/dist/index.js.map

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

boost-clone/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
"main": "lib/index.js",
66
"scripts": {
77
"build": "tsc -p .config/tsconfig.json",
8-
"prepare": "npm run build && node ../utils/esbuild/dist/index.js .",
98
"typecheck": "tsc -p .config/tsconfig.json --noEmit",
109
"test": "jest --config ../jest.config.js --selectProjects boost-clone",
11-
"all": "npm run prepare && npm run test"
10+
"all": "npm run build && node ../utils/esbuild/dist/index.js ."
1211
},
1312
"keywords": [],
1413
"author": "",

cmake-workflow/dist/index.js

Lines changed: 176 additions & 180 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmake-workflow/dist/index.js.map

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmake-workflow/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
"main": "lib/index.js",
66
"scripts": {
77
"build": "tsc -p .config/tsconfig.json",
8-
"prepare": "npm run build && node ../utils/esbuild/dist/index.js .",
98
"typecheck": "tsc -p .config/tsconfig.json --noEmit",
109
"test": "jest --config ../jest.config.js --selectProjects cmake-workflow",
11-
"all": "npm run prepare && npm run test"
10+
"all": "npm run build && node ../utils/esbuild/dist/index.js ."
1211
},
1312
"keywords": [],
1413
"author": "",

0 commit comments

Comments
 (0)