diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 2413c95..ed698a9 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -27,7 +27,27 @@ jobs: run: dotnet build FictionArchive.sln --configuration Release --no-restore /p:SkipFusionBuild=true - name: Run tests - run: dotnet test FictionArchive.sln --configuration Release --no-build --verbosity normal + run: | + dotnet test FictionArchive.sln --configuration Release --no-build --verbosity normal \ + --logger "trx;LogFileName=test-results.trx" \ + --collect:"XPlat Code Coverage" \ + --results-directory ./TestResults + + - name: Upload test results + uses: christopherhx/gitea-upload-artifact@v4 + if: always() + with: + name: test-results + path: ./TestResults/**/*.trx + retention-days: 30 + + - name: Upload coverage results + uses: christopherhx/gitea-upload-artifact@v4 + if: always() + with: + name: coverage-results + path: ./TestResults/**/coverage.cobertura.xml + retention-days: 30 build-frontend: runs-on: ubuntu-latest diff --git a/docker-compose.yml b/docker-compose.yml index c3c26d9..2978d78 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -41,6 +41,11 @@ services: Novelpia__Username: ${NOVELPIA_USERNAME} Novelpia__Password: ${NOVELPIA_PASSWORD} NovelUpdateService__PendingImageUrl: https://files.fictionarchive.orfl.xyz/api/pendingupload.png + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/healthz"] + interval: 30s + timeout: 10s + retries: 3 depends_on: postgres: condition: service_healthy @@ -54,6 +59,11 @@ services: ConnectionStrings__DefaultConnection: Host=postgres;Database=FictionArchive_TranslationService;Username=${POSTGRES_USER:-postgres};Password=${POSTGRES_PASSWORD:-postgres} ConnectionStrings__RabbitMQ: amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASSWORD:-guest}@rabbitmq DeepL__ApiKey: ${DEEPL_API_KEY} + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/healthz"] + interval: 30s + timeout: 10s + retries: 3 depends_on: postgres: condition: service_healthy @@ -66,6 +76,11 @@ services: environment: ConnectionStrings__DefaultConnection: Host=postgres;Database=FictionArchive_SchedulerService;Username=${POSTGRES_USER:-postgres};Password=${POSTGRES_PASSWORD:-postgres} ConnectionStrings__RabbitMQ: amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASSWORD:-guest}@rabbitmq + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/healthz"] + interval: 30s + timeout: 10s + retries: 3 depends_on: postgres: condition: service_healthy @@ -78,6 +93,11 @@ services: environment: ConnectionStrings__DefaultConnection: Host=postgres;Database=FictionArchive_UserService;Username=${POSTGRES_USER:-postgres};Password=${POSTGRES_PASSWORD:-postgres} ConnectionStrings__RabbitMQ: amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASSWORD:-guest}@rabbitmq + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/healthz"] + interval: 30s + timeout: 10s + retries: 3 depends_on: postgres: condition: service_healthy @@ -89,6 +109,11 @@ services: image: git.orfl.xyz/conco/fictionarchive-authentication-service:latest environment: ConnectionStrings__RabbitMQ: amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASSWORD:-guest}@rabbitmq + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/healthz"] + interval: 30s + timeout: 10s + retries: 3 depends_on: rabbitmq: condition: service_healthy @@ -103,6 +128,11 @@ services: S3__AccessKey: ${S3_ACCESS_KEY} S3__SecretKey: ${S3_SECRET_KEY} Proxy__BaseUrl: https://files.orfl.xyz/api + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/healthz"] + interval: 30s + timeout: 10s + retries: 3 labels: - "traefik.enable=true" - "traefik.http.routers.file-service.rule=Host(`files.orfl.xyz`)" @@ -121,6 +151,11 @@ services: image: git.orfl.xyz/conco/fictionarchive-api:latest environment: ConnectionStrings__RabbitMQ: amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASSWORD:-guest}@rabbitmq + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/healthz"] + interval: 30s + timeout: 10s + retries: 3 labels: - "traefik.enable=true" - "traefik.http.routers.api-gateway.rule=Host(`api.fictionarchive.orfl.xyz`)" @@ -141,6 +176,11 @@ services: # =========================================== frontend: image: git.orfl.xyz/conco/fictionarchive-frontend:latest + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/"] + interval: 30s + timeout: 10s + retries: 3 labels: - "traefik.enable=true" - "traefik.http.routers.frontend.rule=Host(`fictionarchive.orfl.xyz`)" diff --git a/fictionarchive-web/.dockerignore b/fictionarchive-web/.dockerignore new file mode 100644 index 0000000..8d3531b --- /dev/null +++ b/fictionarchive-web/.dockerignore @@ -0,0 +1,40 @@ +# Dependencies +node_modules + +# Build output +dist + +# Environment files +.env +.env.local +.env.*.local + +# IDE and editor +.vscode +.idea +*.swp +*.swo + +# Git +.git +.gitignore + +# Logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Test coverage +coverage + +# Docker +Dockerfile +.dockerignore +docker-compose* + +# Documentation +README.md +*.md + +# TypeScript build info +*.tsbuildinfo