Skip to content

Commit

Permalink
ci: update test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Oct 24, 2024
1 parent 21473ad commit c4a5328
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 60 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/bot-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
37 changes: 2 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# .github/workflows/test.yml

name: Test Workflow

on:
Expand All @@ -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/[email protected]
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
44 changes: 22 additions & 22 deletions hivemind-adapter/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
app:
build:
context: .
target: production
dockerfile: Dockerfile
env_file:
- .env

0 comments on commit c4a5328

Please sign in to comment.