Skip to content

Commit 89353e2

Browse files
committed
add timeout minute and correcte ci
1 parent 944297d commit 89353e2

5 files changed

Lines changed: 1297 additions & 36 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
security-scan:
2929
name: Security Scanning
3030
runs-on: ubuntu-latest
31+
timeout-minutes: 15
3132
steps:
3233
- uses: actions/checkout@v4
3334
with:
@@ -73,6 +74,7 @@ jobs:
7374
backend:
7475
name: Backend Tests
7576
runs-on: ubuntu-latest
77+
timeout-minutes: 20
7678
needs: security-scan
7779
services:
7880
postgres:
@@ -114,6 +116,7 @@ jobs:
114116
115117
- name: Install dependencies
116118
working-directory: backend
119+
timeout-minutes: 8
117120
run: |
118121
python -m pip install --upgrade pip
119122
pip install poetry
@@ -130,7 +133,7 @@ jobs:
130133
working-directory: backend
131134
run: |
132135
poetry add bandit
133-
poetry runbandit -r app/ -f json -o bandit-report.json
136+
poetry run bandit -r app/ -f json -o bandit-report.json
134137
continue-on-error: true
135138

136139
- name: Upload Bandit results
@@ -143,6 +146,7 @@ jobs:
143146

144147
- name: Run pytest with coverage
145148
working-directory: backend
149+
timeout-minutes: 10
146150
env:
147151
DATABASE_USER: postgres
148152
DATABASE_PASSWORD: postgres
@@ -164,6 +168,7 @@ jobs:
164168
165169
- name: Run integration tests
166170
working-directory: backend
171+
timeout-minutes: 10
167172
env:
168173
DATABASE_USER: postgres
169174
DATABASE_PASSWORD: postgres
@@ -203,6 +208,7 @@ jobs:
203208
frontend:
204209
name: Frontend Tests
205210
runs-on: ubuntu-latest
211+
timeout-minutes: 20
206212
needs: security-scan
207213
steps:
208214
- uses: actions/checkout@v4
@@ -229,11 +235,12 @@ jobs:
229235

230236
- name: Install dependencies
231237
working-directory: frontend
238+
timeout-minutes: 8
232239
run: npm install && npm ci --prefer-offline --no-audit
233240

234241
- name: Run ESLint
235242
working-directory: frontend
236-
run: npx eslint "src/**/*.{ts,tsx,js,jsx}" -f json -o eslint-report.jso
243+
run: npm run lint
237244
continue-on-error: true
238245

239246
- name: Run TypeScript type-check
@@ -242,7 +249,8 @@ jobs:
242249

243250
- name: Run unit tests with coverage
244251
working-directory: frontend
245-
run: npm test --coverage --watchAll=false --passWithNoTests
252+
timeout-minutes: 10
253+
run: ng test --watch=false --browsers=ChromeHeadlessCI --code-coverage
246254

247255
- name: Upload coverage to Codecov
248256
uses: codecov/codecov-action@v3
@@ -266,6 +274,7 @@ jobs:
266274
terraform-validate:
267275
name: Terraform Validation
268276
runs-on: ubuntu-latest
277+
timeout-minutes: 10
269278
needs: security-scan
270279
steps:
271280
- uses: actions/checkout@v4
@@ -294,6 +303,7 @@ jobs:
294303

295304
- name: Terraform init
296305
working-directory: infra
306+
timeout-minutes: 5
297307
run: terraform init -backend=false
298308

299309
- name: Terraform validate
@@ -303,6 +313,7 @@ jobs:
303313
dependency-check:
304314
name: Dependency Analysis
305315
runs-on: ubuntu-latest
316+
timeout-minutes: 10
306317
steps:
307318
- uses: actions/checkout@v4
308319

@@ -325,6 +336,7 @@ jobs:
325336
build-backend:
326337
name: Build Backend Image
327338
runs-on: ubuntu-latest
339+
timeout-minutes: 20
328340
needs: [backend, terraform-validate]
329341
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/staging')
330342
permissions:
@@ -366,6 +378,7 @@ jobs:
366378
build-frontend:
367379
name: Build Frontend Image
368380
runs-on: ubuntu-latest
381+
timeout-minutes: 20
369382
needs: [frontend, terraform-validate]
370383
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/staging')
371384
permissions:
@@ -407,6 +420,7 @@ jobs:
407420
notify-status:
408421
name: Notify CI Status
409422
runs-on: ubuntu-latest
423+
timeout-minutes: 5
410424
if: always()
411425
needs:
412426
[

frontend/eslint.config.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// @ts-check
2+
const tseslint = require("typescript-eslint");
3+
const angular = require("angular-eslint");
4+
5+
module.exports = tseslint.config(
6+
{
7+
files: ["**/*.ts"],
8+
extends: [
9+
...tseslint.configs.recommended,
10+
...angular.configs.tsRecommended,
11+
],
12+
processor: angular.processInlineTemplates,
13+
rules: {
14+
"@angular-eslint/directive-selector": [
15+
"error",
16+
{ type: "attribute", prefix: "app", style: "camelCase" },
17+
],
18+
"@angular-eslint/component-selector": [
19+
"error",
20+
{ type: "element", prefix: "app", style: "kebab-case" },
21+
],
22+
},
23+
},
24+
{
25+
files: ["**/*.html"],
26+
extends: [
27+
...angular.configs.templateRecommended,
28+
...angular.configs.templateAccessibility,
29+
],
30+
rules: {},
31+
}
32+
);

frontend/karma.conf.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = function (config) {
2+
config.set({
3+
basePath: '',
4+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
5+
plugins: [
6+
require('karma-jasmine'),
7+
require('karma-chrome-launcher'),
8+
require('karma-jasmine-html-reporter'),
9+
require('karma-coverage'),
10+
require('@angular-devkit/build-angular/plugins/karma'),
11+
],
12+
client: {
13+
jasmine: {},
14+
clearContext: false,
15+
},
16+
jasmineHtmlReporter: {
17+
suppressAll: true,
18+
},
19+
coverageReporter: {
20+
dir: require('path').join(__dirname, './coverage'),
21+
subdir: '.',
22+
reporters: [{ type: 'html' }, { type: 'text-summary' }, { type: 'lcovonly' }],
23+
},
24+
reporters: ['progress', 'kjhtml'],
25+
browsers: ['Chrome'],
26+
customLaunchers: {
27+
ChromeHeadlessCI: {
28+
base: 'ChromeHeadless',
29+
flags: ['--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage'],
30+
},
31+
},
32+
restartOnFileChange: true,
33+
});
34+
};

0 commit comments

Comments
 (0)