code-foundry 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,7 @@ force=false
11
11
  languages="${REPO_FOUNDRY_LANGUAGES:-auto}"
12
12
  features="${REPO_FOUNDRY_FEATURES:-all}"
13
13
  package_manager="${REPO_FOUNDRY_PACKAGE_MANAGER:-auto}"
14
+ runtime_repository="${REPO_FOUNDRY_RUNTIME_REPOSITORY:-0xPlayerOne/code-foundry}"
14
15
  bootstrap=true
15
16
  release_type="${REPO_FOUNDRY_RELEASE_TYPE:-auto}"
16
17
  npm_publish="${REPO_FOUNDRY_NPM_PUBLISH:-false}"
@@ -37,6 +38,7 @@ Options:
37
38
  --features LIST all or comma-separated optional features:
38
39
  ci,codeql,security,test,draft-pr,release-pr,release,dependabot
39
40
  --package-manager NAME auto, bun, pnpm, yarn, or npm
41
+ --runtime-repository OWNER/REPO Reusable workflow runtime repository
40
42
  --release-type NAME auto, node, python, rust, or simple
41
43
  --license NAME agpl-3.0-or-later, mit, preserve, or none
42
44
  --license-file PATH Use an exact custom license file
@@ -63,6 +65,7 @@ while [ "$#" -gt 0 ]; do
63
65
  --languages) languages="${2:?missing language list}"; shift 2 ;;
64
66
  --features) features="${2:?missing feature list}"; shift 2 ;;
65
67
  --package-manager) package_manager="${2:?missing package manager}"; shift 2 ;;
68
+ --runtime-repository) runtime_repository="${2:?missing runtime repository}"; shift 2 ;;
66
69
  --release-type) release_type="${2:?missing release type}"; shift 2 ;;
67
70
  --license) license="${2:?missing license}"; shift 2 ;;
68
71
  --license-file) license_file="${2:?missing license file}"; shift 2 ;;
@@ -108,6 +111,7 @@ sync_args=(
108
111
  --languages "$languages"
109
112
  --features "$features"
110
113
  --package-manager "$package_manager"
114
+ --runtime-repository "$runtime_repository"
111
115
  --license "$license"
112
116
  )
113
117
  if [ -n "$license_file" ]; then sync_args+=(--license-file "$license_file"); fi
@@ -127,6 +131,7 @@ profile="$(awk -F': ' '/^profile:/ {print $2; exit}' .github/template.yml 2>/dev
127
131
  languages="$(awk -F': ' '/^languages:/ {print $2; exit}' .github/template.yml 2>/dev/null || true)"
128
132
  features="$(awk -F': ' '/^features:/ {print $2; exit}' .github/template.yml 2>/dev/null || true)"
129
133
  package_manager="$(awk -F': ' '/^package_manager:/ {print $2; exit}' .github/template.yml 2>/dev/null || true)"
134
+ runtime_repository="$(awk -F': ' '/^runtime_repository:/ {print $2; exit}' .github/template.yml 2>/dev/null || true)"
130
135
  release_type="$(awk -F': ' '/^release_type:/ {print $2; exit}' .github/template.yml 2>/dev/null || true)"
131
136
  npm_publish="$(awk -F': ' '/^npm_publish:/ {print $2; exit}' .github/template.yml 2>/dev/null || true)"
132
137
  license="$(awk -F': ' '/^license:/ {print $2; exit}' .github/template.yml 2>/dev/null || true)"
@@ -139,6 +144,7 @@ license="$(awk -F': ' '/^license:/ {print $2; exit}' .github/template.yml 2>/dev
139
144
  printf 'languages: %s\n' "$languages"
140
145
  printf 'features: %s\n' "$features"
141
146
  printf 'package_manager: %s\n' "$package_manager"
147
+ printf 'runtime_repository: %s\n' "$runtime_repository"
142
148
  printf 'release_type: %s\n' "$release_type"
143
149
  printf 'npm_publish: %s\n' "$npm_publish"
144
150
  printf 'license: %s\n' "$license"
@@ -13,6 +13,7 @@ Options:
13
13
  --languages LIST auto or comma-separated: typescript,rust,python,solidity
14
14
  --features LIST all or comma-separated standard features
15
15
  --package-manager NAME auto, bun, pnpm, yarn, or npm
16
+ --runtime-repository OWNER/REPO Reusable workflow runtime repository
16
17
  --license NAME preserve, agpl-3.0-or-later, mit, or none
17
18
  --license-file PATH Use an exact custom license file
18
19
  --check Preview changes (default)
@@ -40,6 +41,9 @@ features_set=false
40
41
  package_manager="${REPO_FOUNDRY_PACKAGE_MANAGER:-}"
41
42
  package_manager_set=false
42
43
  [ -n "${REPO_FOUNDRY_PACKAGE_MANAGER:-}" ] && package_manager_set=true
44
+ runtime_repository="${REPO_FOUNDRY_RUNTIME_REPOSITORY:-}"
45
+ runtime_repository_set=false
46
+ [ -n "${REPO_FOUNDRY_RUNTIME_REPOSITORY:-}" ] && runtime_repository_set=true
43
47
  template_ref=""
44
48
  release_type="${REPO_FOUNDRY_RELEASE_TYPE:-auto}"
45
49
  npm_publish="${REPO_FOUNDRY_NPM_PUBLISH:-false}"
@@ -104,6 +108,7 @@ while [ "$#" -gt 0 ]; do
104
108
  --languages) languages="${2:?missing language list}"; languages_set=true; shift 2 ;;
105
109
  --features) features="${2:?missing feature list}"; features_set=true; shift 2 ;;
106
110
  --package-manager) package_manager="${2:?missing package manager}"; package_manager_set=true; shift 2 ;;
111
+ --runtime-repository) runtime_repository="${2:?missing runtime repository}"; runtime_repository_set=true; shift 2 ;;
107
112
  --license) license="${2:?missing license}"; license_set=true; shift 2 ;;
108
113
  --license-file) license_file="${2:?missing license file}"; shift 2 ;;
109
114
  --check) mode="check"; shift ;;
@@ -132,6 +137,9 @@ if [ -f .github/template.yml ]; then
132
137
  if [ "$package_manager_set" = false ]; then
133
138
  package_manager="$(awk -F': ' '/^package_manager:/ {print $2; exit}' .github/template.yml)"
134
139
  fi
140
+ if [ "$runtime_repository_set" = false ]; then
141
+ runtime_repository="$(awk -F': ' '/^runtime_repository:/ {print $2; exit}' .github/template.yml)"
142
+ fi
135
143
  template_ref="$(awk -F': ' '/^template:/ {print $2; exit}' .github/template.yml)"
136
144
  if [ "$release_type_set" != true ]; then
137
145
  configured_release_type="$(awk -F': ' '/^release_type:/ {print $2; exit}' .github/template.yml)"
@@ -147,6 +155,18 @@ if [ -f .github/template.yml ]; then
147
155
  fi
148
156
  fi
149
157
  [ -n "$package_manager" ] || package_manager=auto
158
+ if [ -z "$runtime_repository" ]; then
159
+ source_repository="$source"
160
+ if [ -d "$source" ]; then
161
+ source_repository="$(git -C "$source" remote get-url origin 2>/dev/null || true)"
162
+ fi
163
+ runtime_repository="$(printf '%s\n' "$source_repository" | sed -nE 's#.*github\.com[:/]([^/]+/[^/.]+)(\.git)?$#\1#p')"
164
+ fi
165
+ [ -n "$runtime_repository" ] || runtime_repository="0xPlayerOne/code-foundry"
166
+ case "$runtime_repository" in
167
+ */*) ;;
168
+ *) printf 'Runtime repository must be OWNER/REPO: %s\n' "$runtime_repository" >&2; exit 2 ;;
169
+ esac
150
170
  case "$package_manager" in
151
171
  auto|bun|pnpm|yarn|npm) ;;
152
172
  *) printf 'Unsupported package manager: %s\n' "$package_manager" >&2; exit 2 ;;
@@ -185,6 +205,7 @@ if [ -f "$template_root/.github/scripts/profile.sh" ]; then
185
205
  REPO_FOUNDRY_LANGUAGES="$languages" \
186
206
  REPO_FOUNDRY_FEATURES="$features" \
187
207
  REPO_FOUNDRY_PACKAGE_MANAGER="$package_manager" \
208
+ REPO_FOUNDRY_RUNTIME_REPOSITORY="$runtime_repository" \
188
209
  REPO_FOUNDRY_RELEASE_TYPE="$release_type" \
189
210
  REPO_FOUNDRY_NPM_PUBLISH="$npm_publish" \
190
211
  bash "$template_root/.github/scripts/profile.sh" detect --root "$PWD"
@@ -354,6 +375,23 @@ for file in "${files[@]}"; do
354
375
  fi
355
376
  done
356
377
 
378
+ # Reusable workflow callers must use a literal repository/ref. Render the
379
+ # selected runtime repository while leaving custom workflows untouched.
380
+ for file in .github/workflows/ci.yml .github/workflows/test.yml; do
381
+ [ -f "$file" ] || continue
382
+ if grep -q '0xPlayerOne/code-foundry' "$file"; then
383
+ changed=$((changed + 1))
384
+ if [ "$mode" = "check" ]; then
385
+ printf 'Would render runtime repository in %s\n' "$file"
386
+ else
387
+ rendered_workflow="$(mktemp)"
388
+ sed "s#0xPlayerOne/code-foundry#$runtime_repository#g" "$file" > "$rendered_workflow"
389
+ mv "$rendered_workflow" "$file"
390
+ printf 'Rendered runtime repository in %s\n' "$file"
391
+ fi
392
+ fi
393
+ done
394
+
357
395
  write_license() {
358
396
  local owner license_source
359
397
  [ "$license" != preserve ] || return 0
@@ -526,6 +564,7 @@ if [ "$mode" = "apply" ]; then
526
564
  if [ -n "$package_manager" ]; then
527
565
  printf 'package_manager: %s\n' "$package_manager"
528
566
  fi
567
+ printf 'runtime_repository: %s\n' "$runtime_repository"
529
568
  printf 'release_type: %s\n' "$release_type"
530
569
  printf 'npm_publish: %s\n' "$npm_publish"
531
570
  printf 'license: %s\n' "$license"
@@ -4,6 +4,7 @@ profile: auto
4
4
  languages: typescript
5
5
  features: all
6
6
  package_manager: bun
7
+ runtime_repository: 0xPlayerOne/code-foundry
7
8
  release_type: node
8
9
  npm_publish: true
9
10
  license: agpl-3.0-or-later
@@ -5,6 +5,7 @@ profile: auto
5
5
  languages: auto
6
6
  features: all
7
7
  package_manager: auto
8
+ runtime_repository: 0xPlayerOne/code-foundry
8
9
  release_type: auto
9
10
  npm_publish: false
10
11
  license: preserve
@@ -13,5 +13,5 @@ permissions:
13
13
  jobs:
14
14
  ci:
15
15
  name: CI
16
- uses: 0xPlayerOne/code-foundry/.github/workflows/reusable-ci.yml@v0.6.0
16
+ uses: 0xPlayerOne/code-foundry/.github/workflows/reusable-ci.yml@v0.7.0
17
17
  secrets: inherit
@@ -12,7 +12,7 @@ on:
12
12
  description: Code Foundry runtime tag or ref.
13
13
  required: false
14
14
  type: string
15
- default: v0.5.0
15
+ default: v0.7.0
16
16
 
17
17
  permissions:
18
18
  contents: read
@@ -0,0 +1,243 @@
1
+ name: Code Foundry Test
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ runtime-repository:
7
+ description: Repository containing the Code Foundry runtime.
8
+ required: false
9
+ type: string
10
+ default: 0xPlayerOne/code-foundry
11
+ runtime-ref:
12
+ description: Code Foundry runtime tag or ref.
13
+ required: false
14
+ type: string
15
+ default: v0.7.0
16
+
17
+ permissions:
18
+ contents: read
19
+
20
+ env:
21
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
22
+ TURBO_TEAM: ${{ vars.TURBO_TEAM }}
23
+ REPO_FOUNDRY_PROFILE: ${{ vars.REPO_FOUNDRY_PROFILE }}
24
+ REPO_FOUNDRY_LANGUAGES: ${{ vars.REPO_FOUNDRY_LANGUAGES }}
25
+ REPO_FOUNDRY_FEATURES: ${{ vars.REPO_FOUNDRY_FEATURES }}
26
+ REPO_FOUNDRY_PACKAGE_MANAGER: ${{ vars.REPO_FOUNDRY_PACKAGE_MANAGER }}
27
+ REPO_FOUNDRY_RUNNER: ${{ vars.REPO_FOUNDRY_RUNNER }}
28
+ REPO_FOUNDRY_CACHE_PACKAGES: ${{ vars.REPO_FOUNDRY_CACHE_PACKAGES || 'auto' }}
29
+ REPO_FOUNDRY_CACHE_BUILD: ${{ vars.REPO_FOUNDRY_CACHE_BUILD || 'auto' }}
30
+ REPO_FOUNDRY_BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before || '' }}
31
+
32
+ concurrency:
33
+ group: ${{ github.workflow }}-${{ github.event.pull_request.head.repo.full_name || github.repository }}-${{ github.event.pull_request.head.ref || github.ref_name }}
34
+ cancel-in-progress: true
35
+
36
+ jobs:
37
+ unit:
38
+ name: Unit
39
+ runs-on: ${{ vars.REPO_FOUNDRY_UNIT_RUNNER || 'ubuntu-slim' }}
40
+ timeout-minutes: 30
41
+ steps:
42
+ - name: Checkout
43
+ uses: actions/checkout@v7
44
+ with:
45
+ fetch-depth: 2
46
+ - name: Runtime
47
+ uses: actions/checkout@v7
48
+ with:
49
+ repository: ${{ inputs.runtime-repository }}
50
+ ref: ${{ inputs.runtime-ref }}
51
+ path: .code-foundry
52
+ sparse-checkout: |
53
+ .github/actions
54
+ .github/scripts
55
+ - name: Install runtime
56
+ run: |
57
+ mkdir -p .github/actions .github/scripts
58
+ cp -R .code-foundry/.github/actions/. .github/actions/
59
+ cp -R .code-foundry/.github/scripts/. .github/scripts/
60
+ - name: Detect
61
+ id: applicability
62
+ run: bash .github/scripts/ci.sh task_profile unit >> "$GITHUB_OUTPUT"
63
+ - name: Setup
64
+ if: steps.applicability.outputs.applicable == 'true'
65
+ uses: ./.github/actions/setup
66
+ with:
67
+ install: true
68
+ install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
69
+ install-python: ${{ steps.applicability.outputs.python == 'true' }}
70
+ install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
71
+ cache-build: false
72
+ cache-environment: false
73
+ cache-packages: ${{ vars.REPO_FOUNDRY_CACHE_PACKAGES || 'auto' }}
74
+ task: unit
75
+ task-javascript: ${{ steps.applicability.outputs.javascript }}
76
+ task-python: ${{ steps.applicability.outputs.python }}
77
+ task-rust: ${{ steps.applicability.outputs.rust }}
78
+ - name: Unit
79
+ if: steps.applicability.outputs.applicable == 'true'
80
+ run: bash .github/scripts/ci.sh unit
81
+ - name: Upload coverage
82
+ if: >-
83
+ always() &&
84
+ steps.applicability.outputs.applicable == 'true' &&
85
+ hashFiles('coverage/**', 'htmlcov/**', '.coverage*', 'target/llvm-cov/**') != ''
86
+ uses: actions/upload-artifact@v7
87
+ with:
88
+ name: coverage-unit-${{ github.run_id }}
89
+ path: |
90
+ coverage/**
91
+ htmlcov/**
92
+ .coverage*
93
+ target/llvm-cov/**
94
+ compression-level: 1
95
+ if-no-files-found: ignore
96
+ retention-days: 14
97
+
98
+ integration:
99
+ name: Integration
100
+ runs-on: ubuntu-latest
101
+ timeout-minutes: 30
102
+ steps:
103
+ - name: Checkout
104
+ uses: actions/checkout@v7
105
+ with:
106
+ fetch-depth: 2
107
+ - name: Runtime
108
+ uses: actions/checkout@v7
109
+ with:
110
+ repository: ${{ inputs.runtime-repository }}
111
+ ref: ${{ inputs.runtime-ref }}
112
+ path: .code-foundry
113
+ sparse-checkout: |
114
+ .github/actions
115
+ .github/scripts
116
+ - name: Install runtime
117
+ run: |
118
+ mkdir -p .github/actions .github/scripts
119
+ cp -R .code-foundry/.github/actions/. .github/actions/
120
+ cp -R .code-foundry/.github/scripts/. .github/scripts/
121
+ - name: Detect
122
+ id: applicability
123
+ run: bash .github/scripts/ci.sh task_profile integration >> "$GITHUB_OUTPUT"
124
+ - name: Setup
125
+ if: steps.applicability.outputs.applicable == 'true'
126
+ uses: ./.github/actions/setup
127
+ with:
128
+ install: true
129
+ install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
130
+ install-python: ${{ steps.applicability.outputs.python == 'true' }}
131
+ install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
132
+ cache-build: ${{ steps.applicability.outputs.rust == 'true' }}
133
+ cache-environment: false
134
+ cache-save: ${{ github.event_name == 'push' }}
135
+ task: integration
136
+ task-javascript: ${{ steps.applicability.outputs.javascript }}
137
+ task-python: ${{ steps.applicability.outputs.python }}
138
+ task-rust: ${{ steps.applicability.outputs.rust }}
139
+ - name: Integration
140
+ if: steps.applicability.outputs.applicable == 'true'
141
+ run: bash .github/scripts/ci.sh integration
142
+
143
+ e2e:
144
+ name: E2E
145
+ runs-on: ubuntu-latest
146
+ timeout-minutes: 45
147
+ steps:
148
+ - name: Checkout
149
+ uses: actions/checkout@v7
150
+ with:
151
+ fetch-depth: 2
152
+ - name: Runtime
153
+ uses: actions/checkout@v7
154
+ with:
155
+ repository: ${{ inputs.runtime-repository }}
156
+ ref: ${{ inputs.runtime-ref }}
157
+ path: .code-foundry
158
+ sparse-checkout: |
159
+ .github/actions
160
+ .github/scripts
161
+ - name: Install runtime
162
+ run: |
163
+ mkdir -p .github/actions .github/scripts
164
+ cp -R .code-foundry/.github/actions/. .github/actions/
165
+ cp -R .code-foundry/.github/scripts/. .github/scripts/
166
+ - name: Detect
167
+ id: applicability
168
+ run: bash .github/scripts/ci.sh task_profile e2e >> "$GITHUB_OUTPUT"
169
+ - name: Cache browser binaries
170
+ if: steps.applicability.outputs.applicable == 'true' && steps.applicability.outputs.browser == 'true'
171
+ uses: ./.github/actions/cache
172
+ with:
173
+ save: ${{ github.event_name == 'push' }}
174
+ path: |
175
+ ~/.cache/ms-playwright
176
+ ~/.cache/Cypress
177
+ ~/.cache/puppeteer
178
+ key: ${{ runner.os }}-e2e-browsers-${{ hashFiles('**/package.json', '**/bun.lock', '**/bun.lockb', '**/pnpm-lock.yaml', '**/yarn.lock', '**/package-lock.json', '**/playwright.config.*', '**/cypress.config.*') }}
179
+ restore-keys: |
180
+ ${{ runner.os }}-e2e-browsers-
181
+ - name: Setup
182
+ if: steps.applicability.outputs.applicable == 'true'
183
+ uses: ./.github/actions/setup
184
+ with:
185
+ install: true
186
+ install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
187
+ install-python: ${{ steps.applicability.outputs.python == 'true' }}
188
+ install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
189
+ cache-build: false
190
+ cache-environment: false
191
+ cache-save: ${{ github.event_name == 'push' }}
192
+ task: e2e
193
+ task-javascript: ${{ steps.applicability.outputs.javascript }}
194
+ task-python: ${{ steps.applicability.outputs.python }}
195
+ task-rust: ${{ steps.applicability.outputs.rust }}
196
+ - name: E2E
197
+ if: steps.applicability.outputs.applicable == 'true'
198
+ run: bash .github/scripts/ci.sh e2e
199
+
200
+ smoke:
201
+ name: Smoke
202
+ runs-on: ubuntu-latest
203
+ timeout-minutes: 15
204
+ steps:
205
+ - name: Checkout
206
+ uses: actions/checkout@v7
207
+ with:
208
+ fetch-depth: 2
209
+ - name: Runtime
210
+ uses: actions/checkout@v7
211
+ with:
212
+ repository: ${{ inputs.runtime-repository }}
213
+ ref: ${{ inputs.runtime-ref }}
214
+ path: .code-foundry
215
+ sparse-checkout: |
216
+ .github/actions
217
+ .github/scripts
218
+ - name: Install runtime
219
+ run: |
220
+ mkdir -p .github/actions .github/scripts
221
+ cp -R .code-foundry/.github/actions/. .github/actions/
222
+ cp -R .code-foundry/.github/scripts/. .github/scripts/
223
+ - name: Detect
224
+ id: applicability
225
+ run: bash .github/scripts/ci.sh task_profile smoke >> "$GITHUB_OUTPUT"
226
+ - name: Setup
227
+ if: steps.applicability.outputs.applicable == 'true'
228
+ uses: ./.github/actions/setup
229
+ with:
230
+ install: true
231
+ install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
232
+ install-python: ${{ steps.applicability.outputs.python == 'true' }}
233
+ install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
234
+ cache-build: false
235
+ cache-environment: false
236
+ cache-save: ${{ github.event_name == 'push' }}
237
+ task: smoke
238
+ task-javascript: ${{ steps.applicability.outputs.javascript }}
239
+ task-python: ${{ steps.applicability.outputs.python }}
240
+ task-rust: ${{ steps.applicability.outputs.rust }}
241
+ - name: Smoke
242
+ if: steps.applicability.outputs.applicable == 'true'
243
+ run: bash .github/scripts/ci.sh smoke
@@ -10,172 +10,8 @@ on:
10
10
  permissions:
11
11
  contents: read
12
12
 
13
- env:
14
- TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
15
- TURBO_TEAM: ${{ vars.TURBO_TEAM }}
16
- REPO_FOUNDRY_PROFILE: ${{ vars.REPO_FOUNDRY_PROFILE }}
17
- REPO_FOUNDRY_LANGUAGES: ${{ vars.REPO_FOUNDRY_LANGUAGES }}
18
- REPO_FOUNDRY_FEATURES: ${{ vars.REPO_FOUNDRY_FEATURES }}
19
- REPO_FOUNDRY_PACKAGE_MANAGER: ${{ vars.REPO_FOUNDRY_PACKAGE_MANAGER }}
20
- REPO_FOUNDRY_CACHE_PACKAGES: ${{ vars.REPO_FOUNDRY_CACHE_PACKAGES || 'auto' }}
21
- REPO_FOUNDRY_CACHE_BUILD: ${{ vars.REPO_FOUNDRY_CACHE_BUILD || 'auto' }}
22
- REPO_FOUNDRY_BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before || '' }}
23
-
24
- concurrency:
25
- group: ${{ github.workflow }}-${{ github.event.pull_request.head.repo.full_name || github.repository }}-${{ github.event.pull_request.head.ref || github.ref_name }}
26
- cancel-in-progress: true
27
-
28
13
  jobs:
29
- unit:
30
- name: Unit
31
- # Keep ordinary suites on the lean image. Set the repository variable
32
- # REPO_FOUNDRY_UNIT_RUNNER=ubuntu-latest for native/system-dependent tests.
33
- runs-on: ${{ vars.REPO_FOUNDRY_UNIT_RUNNER || 'ubuntu-slim' }}
34
- timeout-minutes: 30
35
- steps:
36
- - name: Checkout
37
- uses: actions/checkout@v7
38
- with:
39
- fetch-depth: 2
40
- - name: Detect
41
- id: applicability
42
- run: bash .github/scripts/ci.sh task_profile unit >> "$GITHUB_OUTPUT"
43
- - name: Setup
44
- if: steps.applicability.outputs.applicable == 'true'
45
- uses: ./.github/actions/setup
46
- with:
47
- install: true
48
- install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
49
- install-python: ${{ steps.applicability.outputs.python == 'true' }}
50
- install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
51
- cache-build: false
52
- cache-environment: false
53
- cache-packages: ${{ vars.REPO_FOUNDRY_CACHE_PACKAGES || 'auto' }}
54
- task: unit
55
- task-javascript: ${{ steps.applicability.outputs.javascript }}
56
- task-python: ${{ steps.applicability.outputs.python }}
57
- task-rust: ${{ steps.applicability.outputs.rust }}
58
- - name: Unit
59
- if: steps.applicability.outputs.applicable == 'true'
60
- run: bash .github/scripts/ci.sh unit
61
- - name: Upload coverage
62
- if: >-
63
- always() &&
64
- steps.applicability.outputs.applicable == 'true' &&
65
- hashFiles('coverage/**', 'htmlcov/**', '.coverage*', 'target/llvm-cov/**') != ''
66
- uses: actions/upload-artifact@v7
67
- with:
68
- name: coverage-unit-${{ github.run_id }}
69
- path: |
70
- coverage/**
71
- htmlcov/**
72
- .coverage*
73
- target/llvm-cov/**
74
- compression-level: 1
75
- if-no-files-found: ignore
76
- retention-days: 14
77
-
78
- integration:
79
- name: Integration
80
- runs-on: ubuntu-latest
81
- timeout-minutes: 30
82
- steps:
83
- - name: Checkout
84
- uses: actions/checkout@v7
85
- with:
86
- fetch-depth: 2
87
- - name: Detect
88
- id: applicability
89
- run: bash .github/scripts/ci.sh task_profile integration >> "$GITHUB_OUTPUT"
90
- - name: Setup
91
- if: steps.applicability.outputs.applicable == 'true'
92
- uses: ./.github/actions/setup
93
- with:
94
- install: true
95
- install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
96
- install-python: ${{ steps.applicability.outputs.python == 'true' }}
97
- install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
98
- cache-build: ${{ steps.applicability.outputs.rust == 'true' }}
99
- cache-environment: false
100
- cache-save: ${{ github.event_name == 'push' }}
101
- task: integration
102
- task-javascript: ${{ steps.applicability.outputs.javascript }}
103
- task-python: ${{ steps.applicability.outputs.python }}
104
- task-rust: ${{ steps.applicability.outputs.rust }}
105
- - name: Integration
106
- if: steps.applicability.outputs.applicable == 'true'
107
- run: bash .github/scripts/ci.sh integration
108
-
109
- e2e:
110
- name: E2E
111
- runs-on: ubuntu-latest
112
- timeout-minutes: 45
113
- steps:
114
- - name: Checkout
115
- uses: actions/checkout@v7
116
- with:
117
- fetch-depth: 2
118
- - name: Detect
119
- id: applicability
120
- run: bash .github/scripts/ci.sh task_profile e2e >> "$GITHUB_OUTPUT"
121
- - name: Cache browser binaries
122
- if: steps.applicability.outputs.applicable == 'true' && steps.applicability.outputs.browser == 'true'
123
- uses: ./.github/actions/cache
124
- with:
125
- save: ${{ github.event_name == 'push' }}
126
- path: |
127
- ~/.cache/ms-playwright
128
- ~/.cache/Cypress
129
- ~/.cache/puppeteer
130
- key: ${{ runner.os }}-e2e-browsers-${{ hashFiles('**/package.json', '**/bun.lock', '**/bun.lockb', '**/pnpm-lock.yaml', '**/yarn.lock', '**/package-lock.json', '**/playwright.config.*', '**/cypress.config.*') }}
131
- restore-keys: |
132
- ${{ runner.os }}-e2e-browsers-
133
- - name: Setup
134
- if: steps.applicability.outputs.applicable == 'true'
135
- uses: ./.github/actions/setup
136
- with:
137
- install: true
138
- install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
139
- install-python: ${{ steps.applicability.outputs.python == 'true' }}
140
- install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
141
- cache-build: false
142
- cache-environment: false
143
- cache-save: ${{ github.event_name == 'push' }}
144
- task: e2e
145
- task-javascript: ${{ steps.applicability.outputs.javascript }}
146
- task-python: ${{ steps.applicability.outputs.python }}
147
- task-rust: ${{ steps.applicability.outputs.rust }}
148
- - name: E2E
149
- if: steps.applicability.outputs.applicable == 'true'
150
- run: bash .github/scripts/ci.sh e2e
151
-
152
- smoke:
153
- name: Smoke
154
- runs-on: ubuntu-latest
155
- timeout-minutes: 15
156
- steps:
157
- - name: Checkout
158
- uses: actions/checkout@v7
159
- with:
160
- fetch-depth: 2
161
- - name: Detect
162
- id: applicability
163
- run: bash .github/scripts/ci.sh task_profile smoke >> "$GITHUB_OUTPUT"
164
- - name: Setup
165
- if: steps.applicability.outputs.applicable == 'true'
166
- uses: ./.github/actions/setup
167
- with:
168
- install: true
169
- install-javascript: ${{ steps.applicability.outputs.javascript == 'true' }}
170
- install-python: ${{ steps.applicability.outputs.python == 'true' }}
171
- install-rust: ${{ steps.applicability.outputs.rust == 'true' }}
172
- cache-build: false
173
- cache-environment: false
174
- cache-save: ${{ github.event_name == 'push' }}
175
- task: smoke
176
- task-javascript: ${{ steps.applicability.outputs.javascript }}
177
- task-python: ${{ steps.applicability.outputs.python }}
178
- task-rust: ${{ steps.applicability.outputs.rust }}
179
- - name: Smoke
180
- if: steps.applicability.outputs.applicable == 'true'
181
- run: bash .github/scripts/ci.sh smoke
14
+ test:
15
+ name: Test
16
+ uses: 0xPlayerOne/code-foundry/.github/workflows/reusable-test.yml@v0.8.0
17
+ secrets: inherit
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.0](https://github.com/0xPlayerOne/code-foundry/compare/v0.8.0...v0.9.0) (2026-07-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * **init:** configure reusable workflow repository ([95d17e9](https://github.com/0xPlayerOne/code-foundry/commit/95d17e9a4af2e2075fcdc2c357af414876655fb3))
9
+
10
+ ## [0.8.0](https://github.com/0xPlayerOne/code-foundry/compare/v0.7.0...v0.8.0) (2026-07-28)
11
+
12
+
13
+ ### Features
14
+
15
+ * **test:** add reusable test workflow runtime ([5a1f4cf](https://github.com/0xPlayerOne/code-foundry/commit/5a1f4cfadb6b11f27b001ba8f6424b11de32fd64))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **test:** keep local workflow during runtime release ([8827659](https://github.com/0xPlayerOne/code-foundry/commit/88276590451ee6b3230ad3b1349ccd4785a686bf))
21
+
3
22
  ## [0.7.0](https://github.com/0xPlayerOne/code-foundry/compare/v0.6.0...v0.7.0) (2026-07-28)
4
23
 
5
24
 
package/README.md CHANGED
@@ -36,6 +36,12 @@ npx code-foundry init --license agpl-3.0-or-later
36
36
  npx code-foundry init --license-file ./legal/LICENSE.txt
37
37
  ```
38
38
 
39
+ Reusable workflow callers default to this package's public runtime. Use
40
+ `--runtime-repository OWNER/REPO` when initializing from an organization fork;
41
+ the selected repository is saved in `.github/template.yml` and rendered into
42
+ the small `ci.yml` and `test.yml` wrappers automatically. The equivalent
43
+ environment variable is `REPO_FOUNDRY_RUNTIME_REPOSITORY`.
44
+
39
45
  Initialization defaults to AGPL for new repositories. Synchronization defaults
40
46
  to `--license preserve`, so an existing repository's license is never replaced
41
47
  unless you explicitly select a license or provide `--license-file`.
@@ -84,7 +90,7 @@ bash .github/scripts/init-repo.sh \
84
90
 
85
91
  Supported profiles are `application`, `monorepo`, and `minimal`; use `auto` to detect one. Supported languages are `typescript`, `rust`, `python`, and `solidity`. Supported feature flags are `ci`, `codeql`, `security`, `test`, `draft-pr`, `release-pr`, `release`, and `dependabot`. Use `--prune` only when you explicitly want disabled standard workflows removed; custom workflows are always preserved. The selected profile is stored in `.github/template.yml`, which makes later syncs repeatable and lets workflows consume repository-specific settings without duplicating the template scripts.
86
92
 
87
- Profile precedence is consistent everywhere: explicit CLI flags, then `REPO_FOUNDRY_*` GitHub repository variables/environment values, then `.github/template.yml`, then automatic detection and standard defaults. Useful repository variables include `REPO_FOUNDRY_PROFILE`, `REPO_FOUNDRY_LANGUAGES`, `REPO_FOUNDRY_FEATURES`, `REPO_FOUNDRY_PACKAGE_MANAGER`, `REPO_FOUNDRY_RUNNER`, `REPO_FOUNDRY_UNIT_RUNNER`, `REPO_FOUNDRY_CACHE_PACKAGES`, `REPO_FOUNDRY_CACHE_BUILD`, `REPO_FOUNDRY_COVERAGE_MINIMUM`, and `REPO_FOUNDRY_TURBO_REMOTE`. Use CLI flags for one-off initialization; use repository variables for local overrides that should not be committed.
93
+ Profile precedence is consistent everywhere: explicit CLI flags, then `REPO_FOUNDRY_*` GitHub repository variables/environment values, then `.github/template.yml`, then automatic detection and standard defaults. Useful repository variables include `REPO_FOUNDRY_PROFILE`, `REPO_FOUNDRY_LANGUAGES`, `REPO_FOUNDRY_FEATURES`, `REPO_FOUNDRY_PACKAGE_MANAGER`, `REPO_FOUNDRY_RUNTIME_REPOSITORY`, `REPO_FOUNDRY_RUNNER`, `REPO_FOUNDRY_UNIT_RUNNER`, `REPO_FOUNDRY_CACHE_PACKAGES`, `REPO_FOUNDRY_CACHE_BUILD`, `REPO_FOUNDRY_COVERAGE_MINIMUM`, and `REPO_FOUNDRY_TURBO_REMOTE`. Use CLI flags for one-off initialization; use repository variables for local overrides that should not be committed.
88
94
 
89
95
  Inspect the resolved profile at any time with `bash .github/scripts/profile.sh detect`; use `profile.sh get KEY` when another script needs one setting.
90
96
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-foundry",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "A fast, language-aware repository factory for agent-ready workflows, testing, security, and release automation.",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",
package/src/cli.mjs CHANGED
@@ -22,6 +22,7 @@ Init/sync options:
22
22
  --languages LIST auto or typescript,rust,python,solidity
23
23
  --features LIST all or ci,codeql,security,test,draft-pr,release-pr,release,dependabot
24
24
  --package-manager NAME auto, bun, pnpm, yarn, or npm
25
+ --runtime-repository OWNER/REPO Reusable workflow runtime repository
25
26
  --release-type NAME auto, node, python, rust, simple, or none
26
27
  --license NAME agpl-3.0-or-later, mit, preserve, or none
27
28
  --license-file PATH Use an exact custom license file
@@ -49,6 +50,7 @@ function parseArgs(argv) {
49
50
  languages: process.env.REPO_FOUNDRY_LANGUAGES || 'auto',
50
51
  features: process.env.REPO_FOUNDRY_FEATURES || 'all',
51
52
  packageManager: process.env.REPO_FOUNDRY_PACKAGE_MANAGER || 'auto',
53
+ runtimeRepository: process.env.REPO_FOUNDRY_RUNTIME_REPOSITORY || '0xPlayerOne/code-foundry',
52
54
  releaseType: process.env.REPO_FOUNDRY_RELEASE_TYPE || 'auto',
53
55
  license: process.env.REPO_FOUNDRY_LICENSE || (command === 'init' ? 'agpl-3.0-or-later' : 'preserve'),
54
56
  licenseFile: process.env.REPO_FOUNDRY_LICENSE_FILE || '',
@@ -69,6 +71,7 @@ function parseArgs(argv) {
69
71
  ['--languages', 'languages'],
70
72
  ['--features', 'features'],
71
73
  ['--package-manager', 'packageManager'],
74
+ ['--runtime-repository', 'runtimeRepository'],
72
75
  ['--release-type', 'releaseType'],
73
76
  ['--license', 'license'],
74
77
  ['--license-file', 'licenseFile'],
@@ -120,6 +123,7 @@ function main() {
120
123
  if (options.licenseFile) common.push('--license-file', options.licenseFile)
121
124
  if (options.languagesSet) common.push('--languages', options.languages)
122
125
  if (options.featuresSet) common.push('--features', options.features)
126
+ common.push('--runtime-repository', options.runtimeRepository)
123
127
  if (options.prune) common.push('--prune')
124
128
  if (options.force) common.push('--force')
125
129
  if (options.dryRun) common.push('--check')
@@ -133,6 +137,7 @@ function main() {
133
137
  '--languages', options.languages,
134
138
  '--features', options.features,
135
139
  '--package-manager', options.packageManager,
140
+ '--runtime-repository', options.runtimeRepository,
136
141
  '--release-type', options.releaseType,
137
142
  '--license', options.license,
138
143
  ]