From c4a53281dd3ea5c62f7c0b93feb1f7e0e36810e8 Mon Sep 17 00:00:00 2001 From: Behzad Rabiei Date: Thu, 24 Oct 2024 15:50:27 +0400 Subject: [PATCH] ci: update test ci --- .github/workflows/bot-ci.yml | 4 +-- .github/workflows/test.yml | 37 ++---------------------- hivemind-adapter/docker-compose.yml | 44 ++++++++++++++--------------- 3 files changed, 25 insertions(+), 60 deletions(-) diff --git a/.github/workflows/bot-ci.yml b/.github/workflows/bot-ci.yml index ae7fce52..fc8a96e7 100644 --- a/.github/workflows/bot-ci.yml +++ b/.github/workflows/bot-ci.yml @@ -19,9 +19,7 @@ jobs: test: uses: ./.github/workflows/test.yml with: - app_path: "./bot" - node_version: "20" - cache_dependency_path: "./bot/package-lock.json" + app_path: "bot" build-push: needs: [lint, test] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8d0d13b2..b0ee61ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,4 @@ # .github/workflows/test.yml - name: Test Workflow on: @@ -9,43 +8,11 @@ on: description: "Path to the application directory" required: true type: string - node_version: - description: "Node.js version to use" - required: true - type: string - cache_dependency_path: - description: "Path to the package-lock.json file" - required: true - type: string jobs: test: name: Test runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: ${{ inputs.node_version }} - cache: "npm" - cache-dependency-path: ${{ inputs.cache_dependency_path }} - - - name: Install Dependencies - run: npm install --force - working-directory: ${{ inputs.app_path }} - - - name: Run Tests - run: npm run test - working-directory: ${{ inputs.app_path }} - - - name: Upload Code Coverage - if: ${{ secrets.CC_TEST_REPORTER_ID != '' }} - uses: paambaati/codeclimate-action@v5.0.0 - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - with: - coverageCommand: npm run test:cov - working-directory: ${{ inputs.app_path }} + - uses: actions/checkout@v4 + - run: docker compose -f ${{ inputs.app_path }}/docker-compose.test.yml up --exit-code-from app diff --git a/hivemind-adapter/docker-compose.yml b/hivemind-adapter/docker-compose.yml index bb9d064e..6bc52f8d 100644 --- a/hivemind-adapter/docker-compose.yml +++ b/hivemind-adapter/docker-compose.yml @@ -1,25 +1,25 @@ -version: "3.9" +version: '3.9' services: - nginx: - container_name: nginx - image: nginx:latest - restart: unless-stopped - ports: - - 80:80 - - 443:443 - volumes: - - ./nginx/templates:/etc/nginx/templates:ro - - ./nginx/ssl:/etc/ssl:ro - env_file: - - ./.env.nginx - depends_on: - - app + nginx: + container_name: nginx + image: nginx:latest + restart: unless-stopped + ports: + - 80:80 + - 443:443 + volumes: + - ./nginx/templates:/etc/nginx/templates:ro + - ./nginx/ssl:/etc/ssl:ro + env_file: + - ./.env.nginx + depends_on: + - app - app: - build: - context: . - target: production - dockerfile: Dockerfile - env_file: - - .env \ No newline at end of file + app: + build: + context: . + target: production + dockerfile: Dockerfile + env_file: + - .env