Skip to content
Merged
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
31 changes: 30 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
# Node modules and build output
node_modules/
dist/

# Environment and secrets
.env
*.env
*.log

# Git and docs
.git
*.md
.git

# Test files and folders
__tests__/
tests/
*.test.js
*.test.ts
*.spec.js
*.spec.ts

# Terraform files and secrets
*.tf
*.tfvars
*.tfstate
*.tfstate.*
.terraform/
terraform.tfstate
terraform.tfstate.*

# Misc
Dockerfile*
docker-compose.yml
*.swp
*.bak
46 changes: 46 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI - Coverage Report

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x]

steps:
- name: 📥 Checkout code
uses: actions/checkout@v4

- name: 📦 Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: 🟢 Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: 📦 Install dependencies
run: pnpm install

- name: 🔨 Build the app (NestJS)
run: pnpm run build

- name: 🧪 Run tests
run: pnpm run test:cov

- name: 📤 Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
18 changes: 4 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: CI - Test & Coverage
name: CI - Test

on:
push:
branches: [main]
pull_request:
branches: [main]
on: [push, pull_request]

jobs:
build:
Expand Down Expand Up @@ -35,11 +31,5 @@ jobs:
- name: 🔨 Build the app (NestJS)
run: pnpm run build

- name: 🧪 Run tests with coverage
run: pnpm run test:cov -t controller

- name: 📤 Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
- name: 🧪 Run tests
run: pnpm run test
12 changes: 10 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ aliasPaths["^@prisma/(?!(client(?:/.*)?$))(.*)$"] = "<rootDir>/src/prisma/$2";
const jestConfig: Config = {
preset: "ts-jest",
moduleFileExtensions: ["ts", "js", "json"],
rootDir: "./",
roots: ["<rootDir>/src"],
roots: ["src"],
testEnvironment: "node",
moduleNameMapper: aliasPaths,
coverageDirectory: "coverage",
coverageReporters: ["text", "lcov"],
collectCoverageFrom: [
"src/**/*.{ts,js}",
"!src/main.ts", // exclude entry point
"!src/**/index.ts", // exclude barrel files
"!src/**/*.module.ts", // exclude module files
"!src/**/*.d.ts", // exclude type definitions
],
};

export default jestConfig;
File renamed without changes.
7 changes: 1 addition & 6 deletions main.tf → terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ terraform {
provider "docker" {}

resource "docker_image" "app_image" {
name = var.image_name
# we could also make the image build automatically but this causes issues with the tfstate file
# build {
# context = path.module
# dockerfile = "Dockerfile"
# }
name = var.image_name
keep_locally = true
}

Expand Down
File renamed without changes.
Loading