All checks were successful
Setup testing environment and test the code / build (push) Successful in 1m24s
57 lines
1.3 KiB
YAML
57 lines
1.3 KiB
YAML
name: Setup testing environment and test the code
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [ "main" ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
mongodb:
|
|
image: mongo:6.0
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
|
|
api:
|
|
image: git.chatenium.hu/chatenium/api:latest
|
|
credentials:
|
|
username: ${{ secrets.REPO_USER }}
|
|
password: ${{ secrets.REPO_TOKEN }}
|
|
env:
|
|
ENVIRONMENT_TYPE: "testing"
|
|
MONGODB_URL: mongodb://mongodb:27017
|
|
REDIS_SERVER_ADDR: redis:6379
|
|
|
|
cdn:
|
|
image: git.chatenium.hu/chatenium/cdn:latest
|
|
credentials:
|
|
username: ${{ secrets.REPO_USER }}
|
|
password: ${{ secrets.REPO_TOKEN }}
|
|
env:
|
|
ENVIRONMENT: "testing"
|
|
REDIS_SERVER_ADDR: redis:6379
|
|
MAIN_API_URL: http://api:3000
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '24'
|
|
|
|
- name: Create .env file
|
|
run: |
|
|
echo "API_URL=http://api:3000" >> .env
|
|
echo "CDN_URL=http://cdn:4000" >> .env
|
|
echo "WS_URL=ws://api:3000" >> .env
|
|
|
|
- name: Run Vitest
|
|
run: |
|
|
npm install
|
|
npm test --experimental-websocket |