11name : DevForge CI/CD Pipeline
2-
32on :
43 push :
54 branches : [ main, master, develop ]
1312 default : ' patch'
1413 type : choice
1514 options :
16- - patch
17- - minor
18- - major
15+ - patch
16+ - minor
17+ - major
1918 run_security_tests :
2019 description : ' Run security tests'
2120 required : false
2625 required : false
2726 default : false
2827 type : boolean
29-
3028jobs :
3129 lint :
3230 name : Lint Code
3331 runs-on : ubuntu-latest
34-
3532 steps :
3633 - name : Checkout Repository
3734 uses : actions/checkout@v3
38-
3935 - name : Set up Node.js
4036 uses : actions/setup-node@v3
4137 with :
4238 node-version : ' 18'
4339 cache : ' npm'
44-
4540 - name : Install Dependencies
4641 run : npm ci
47-
4842 - name : Run ESLint
4943 run : npm run lint
50-
44+
5145 test :
5246 name : Run Tests
5347 runs-on : ubuntu-latest
5448 needs : lint
55-
5649 steps :
5750 - name : Checkout Repository
5851 uses : actions/checkout@v3
59-
6052 - name : Set up Node.js
6153 uses : actions/setup-node@v3
6254 with :
6355 node-version : ' 18'
6456 cache : ' npm'
65-
6657 - name : Install Dependencies
6758 run : npm ci
68-
6959 - name : Install Playwright Browsers
7060 run : npx playwright install chromium
71-
7261 - name : Start DevForge Server
7362 run : node bin/dev-server-runner.js start
7463 env :
7564 SERVER_PORT : 5050
7665 PUBLIC_DIR : ' public'
7766 LOG_LEVEL : ' info'
78-
7967 - name : Run Unit Tests
8068 run : npm test
81-
8269 - name : Stop DevForge Server
8370 run : node bin/dev-server-runner.js stop
8471 - name : Upload Test Results
@@ -87,62 +74,50 @@ jobs:
8774 with :
8875 name : unit-test-results
8976 path : test-results/
90- test-results/
91-
77+
9278 security_tests :
9379 name : Run Security Tests
9480 runs-on : ubuntu-latest
9581 needs : test
9682 if : github.event.inputs.run_security_tests != 'false'
97-
9883 steps :
9984 - name : Checkout Repository
10085 uses : actions/checkout@v3
101-
10286 - name : Set up Node.js
10387 uses : actions/setup-node@v3
10488 with :
10589 node-version : ' 18'
10690 cache : ' npm'
107-
10891 - name : Install Dependencies
10992 run : npm ci
110-
11193 - name : Install Playwright Browsers
11294 run : npx playwright install chromium
113-
11495 - name : Start DevForge Server
11596 run : node bin/dev-server-runner.js start
11697 env :
11798 SERVER_PORT : 5050
11899 PUBLIC_DIR : ' public'
119100 LOG_LEVEL : ' info'
120101 MOCK_MODE : ' true'
121-
122102 - name : Run Security Tests
123103 run : npm run test:security
124104 env :
125105 MOCK_MODE : ' true'
126-
127106 - name : Run Flash Loan Attack Tests
128107 run : npx playwright test examples/security-bug-tests/flash-loan-attack.test.ts
129108 env :
130109 MOCK_MODE : ' true'
131-
132110 - name : Run Eth Sign Phishing Tests
133111 run : npm run test:phishing
134112 env :
135113 MOCK_MODE : ' true'
136-
137114 - name : Run Reentrancy Tests
138115 run : npm run test:reentrancy
139116 env :
140117 MOCK_MODE : ' true'
141-
142118 - name : Stop DevForge Server
143119 run : node bin/dev-server-runner.js stop
144120 if : always()
145-
146121 - name : Upload Security Test Results
147122 uses : actions/upload-artifact@v3.1.3
148123 if : always()
@@ -151,86 +126,78 @@ jobs:
151126 path : |
152127 test-results/
153128 playwright-report/
154-
155129 - name : Generate Security Report
156130 if : success()
157131 run : npm run report:generate
158-
159132 - name : Upload Security Report
160133 uses : actions/upload-artifact@v3.1.3
161134 if : success()
162135 with :
163136 name : security-report
164- path : |
165- reports/
166-
167- docker_build :
168- name : Build and Test Docker Image
137+ path : reports/
138+
139+ validate_deploy_config :
140+ name : Validate Railway/Nixpacks Deploy Config
169141 runs-on : ubuntu-latest
170142 needs : [test, security_tests]
171-
143+ # NOTE: No Dockerfile in this repo - Railway auto-deploys via Nixpacks.
144+ # This job validates the Nixpacks config instead of building a Docker image.
172145 steps :
173146 - name : Checkout Repository
174147 uses : actions/checkout@v3
175-
176- - name : Set up Docker Buildx
177- uses : docker/setup-buildx-action@v1
178-
179- - name : Build Docker Image
180- uses : docker/build-push-action@v2
181- with :
182- context : .
183- push : false
184- load : true
185- tags : devforge:test
186- cache-from : type=gha
187- cache-to : type=gha,mode=max
188-
189- - name : Test Docker Image
148+ - name : Check railway.toml exists
190149 run : |
191- docker run --name devforge-test -d -p 5050:5050 devforge:test
192- sleep 5
193- curl -s http://localhost:5050/health || curl -s http://localhost:5051/health
194- docker stop devforge-test
195-
150+ if [ -f railway.toml ]; then
151+ echo "railway.toml found - Nixpacks deploy config OK"
152+ cat railway.toml
153+ else
154+ echo "WARNING: railway.toml not found - Railway will use auto-detection"
155+ fi
156+ - name : Validate Node.js start script
157+ run : |
158+ START_CMD=$(node -p "require('./package.json').scripts.start || ''" 2>/dev/null || echo '')
159+ if [ -n "$START_CMD" ]; then
160+ echo "Start script found: $START_CMD"
161+ else
162+ echo "WARNING: No start script in package.json"
163+ fi
164+ - name : Confirm no Dockerfile needed
165+ run : |
166+ echo "Railway deployment uses Nixpacks (not Docker)."
167+ echo "GHA docker_build step removed - Railway handles container build automatically."
168+ echo "Deploy status: https://railway.app - check Railway dashboard for live deploy."
169+
196170 build :
197171 name : Build Package
198172 runs-on : ubuntu-latest
199173 needs : [test, security_tests]
200174 if : github.event_name == 'push' || github.event_name == 'workflow_dispatch'
201-
202175 steps :
203176 - name : Checkout Repository
204177 uses : actions/checkout@v3
205-
206178 - name : Set up Node.js
207179 uses : actions/setup-node@v3
208180 with :
209181 node-version : ' 18'
210182 cache : ' npm'
211-
212183 - name : Install Dependencies
213184 run : npm ci
214-
215185 - name : Build Package
216186 run : npm run build
217-
218187 - name : Upload Build Artifact
219188 uses : actions/upload-artifact@v3.1.3
220189 with :
221190 name : build-package
222191 path : dist/
223-
192+
224193 release :
225194 name : Publish Release
226195 runs-on : ubuntu-latest
227- needs : [build, docker_build ]
196+ needs : [build, validate_deploy_config ]
228197 if : github.event_name == 'workflow_dispatch' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && (github.event.inputs.release_dry_run != 'true')
229-
230198 steps :
231199 - name : Checkout Repository
232200 uses : actions/checkout@v3
233-
234201 - name : Set up Node.js
235202 uses : actions/setup-node@v3
236203 with :
@@ -243,7 +210,6 @@ jobs:
243210 path : dist/
244211 - name : Install Dependencies
245212 run : npm ci
246-
247213 - name : Check for NPM token
248214 id : check_token
249215 run : |
@@ -253,7 +219,6 @@ jobs:
253219 echo "npm_token_exists=false" >> $GITHUB_OUTPUT
254220 echo "::warning::NPM_TOKEN secret not found. Skipping npm publish."
255221 fi
256-
257222 - name : Version and Publish
258223 if : steps.check_token.outputs.npm_token_exists == 'true'
259224 id : version_publish
@@ -267,7 +232,6 @@ jobs:
267232 npm publish
268233 env :
269234 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
270-
271235 - name : Create GitHub Release
272236 id : create_release
273237 uses : actions/create-release@v1
@@ -278,7 +242,6 @@ jobs:
278242 release_name : DevForge v${{ steps.version_publish.outputs.VERSION }}
279243 draft : false
280244 prerelease : false
281-
282245 - name : Upload Security Report to Release
283246 if : steps.check_token.outputs.npm_token_exists == 'true'
284247 uses : actions/upload-release-asset@v1
@@ -289,36 +252,31 @@ jobs:
289252 asset_path : ./reports/security-report.html
290253 asset_name : security-report.html
291254 asset_content_type : text/html
292-
255+
293256 deploy_docs :
294257 name : Deploy Documentation
295258 runs-on : ubuntu-latest
296259 needs : [build]
297260 if : github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
298-
299261 steps :
300262 - name : Checkout Repository
301263 uses : actions/checkout@v3
302-
303264 - name : Set up Node.js
304265 uses : actions/setup-node@v3
305266 with :
306267 node-version : ' 18'
307268 cache : ' npm'
308-
309269 - name : Install Dependencies
310270 run : npm ci
311-
312271 - name : Generate Documentation
313272 run : |
314273 mkdir -p public
315274 cp -r docs public/
316275 cp README.md public/
317276 cp landing-page.html public/index.html
318277 cp CONTRIBUTING.md public/
319-
320278 - name : Deploy to GitHub Pages
321279 uses : peaceiris/actions-gh-pages@v3
322280 with :
323281 github_token : ${{ secrets.GITHUB_TOKEN }}
324- publish_dir : ./public
282+ publish_dir : ./public
0 commit comments