Skip to content

Commit 5fd65fc

Browse files
Merge branch 'main' into ADE-30
2 parents 8c322a8 + 127e116 commit 5fd65fc

Some content is hidden

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

46 files changed

+1955
-183
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Backend Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
paths:
7+
- 'backend/**'
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: ./backend
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '18'
23+
cache: 'npm'
24+
cache-dependency-path: './backend/package-lock.json'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run linting
30+
run: npm run lint
31+
32+
- name: Run tests
33+
run: npm test
34+
35+
- name: Generate test summary
36+
if: always()
37+
run: |
38+
echo "# Backend Test Results" >> $GITHUB_STEP_SUMMARY
39+
if [ ${{ job.status }} == "success" ]; then
40+
echo "✅ All tests passed successfully!" >> $GITHUB_STEP_SUMMARY
41+
else
42+
echo "❌ Some tests failed. Please check the logs for details." >> $GITHUB_STEP_SUMMARY
43+
fi
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Frontend Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
paths:
7+
- 'frontend/**'
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: ./frontend
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '18'
23+
cache: 'npm'
24+
cache-dependency-path: './frontend/package-lock.json'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run tests
30+
env:
31+
VITE_BASE_URL_API: https://jsonplaceholder.typicode.com
32+
VITE_BUILD_DATE: 1970-01-01
33+
VITE_BUILD_TIME: 00:00:00
34+
VITE_BUILD_TS: 1970-01-01T00:00:00+0000
35+
VITE_BUILD_COMMIT_SHA: test
36+
VITE_BUILD_ENV_CODE: test
37+
VITE_BUILD_WORKFLOW_RUNNER: test
38+
VITE_BUILD_WORKFLOW_NAME: test
39+
VITE_BUILD_WORKFLOW_RUN_NUMBER: 1
40+
VITE_BUILD_WORKFLOW_RUN_ATTEMPT: 1
41+
run: npm test

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
cd frontend && npm run lint
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Construct } from 'constructs';
2+
import { RemovalPolicy } from 'aws-cdk-lib';
3+
import { AttributeType, BillingMode, Table } from 'aws-cdk-lib/aws-dynamodb';
4+
5+
export function createReportsTable(scope: Construct, id: string): Table {
6+
const table = new Table(scope, id, {
7+
tableName: 'reports',
8+
partitionKey: {
9+
name: 'id',
10+
type: AttributeType.STRING,
11+
},
12+
billingMode: BillingMode.PAY_PER_REQUEST,
13+
removalPolicy: RemovalPolicy.RETAIN,
14+
});
15+
16+
// Add a GSI for querying by userId
17+
table.addGlobalSecondaryIndex({
18+
indexName: 'userIdIndex',
19+
partitionKey: {
20+
name: 'userId',
21+
type: AttributeType.STRING,
22+
},
23+
sortKey: {
24+
name: 'createdAt',
25+
type: AttributeType.STRING,
26+
},
27+
});
28+
29+
return table;
30+
}

backend/nest-cli.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"collection": "@nestjs/schematics",
3+
"sourceRoot": "src",
4+
"compilerOptions": {
5+
"deleteOutDir": true
6+
}
7+
}

0 commit comments

Comments
 (0)