Skip to content
Merged

Ci #9

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 27 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ on:
jobs:
build-and-test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8
ports:
- 3306:3306
env:
MYSQL_DATABASE: root
MYSQL_ROOT_PASSWORD: fulll-backend-root
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5

steps:
- name: Checkout code
Expand All @@ -19,21 +32,27 @@ jobs:
with:
node-version: '20'

- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-

- name: Install dependencies
run: npm ci

- name: Wait for MySQL to be ready
run: |
until mysqladmin ping -h "127.0.0.1" --silent; do
echo "Waiting for MySQL..."
sleep 2
done

- name: Run Prisma migrations
run: |
npx prisma migrate deploy
npx prisma generate

- name: Lint code
run: npm run lint

- name: Run unit tests
env:
DATABASE_URL: mysql://root:fulll-backend-root@localhost:3306/db
run: npm test

- name: Run BDD tests
Expand Down
4 changes: 0 additions & 4 deletions src/Domain/Models/Fleet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,4 @@ export class Fleet {

return vehicle;
}

private generateVehicleId() {
return crypto.randomUUID(); // TODO: Add a port
}
}
1 change: 0 additions & 1 deletion src/Primary/CLI/updateLocationCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
ParkVehicle,
ParkVehicleHandler,
} from "../../App/Commands/parkVehicle.js";
import { VehicleAlreadyParkedAtThisLocationError } from "../../Domain/Errors/VehicleAlreadyParkedAtThisLocationError.js";

export const updateLocationCommand: CommandModule = {
command:
Expand Down