Skip to content

Merge pull request #132 from marvin-wtt/marvin-wtt-patch-1 #326

Merge pull request #132 from marvin-wtt/marvin-wtt-patch-1

Merge pull request #132 from marvin-wtt/marvin-wtt-patch-1 #326

Workflow file for this run

name: Build and Test
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- ready_for_review
jobs:
build-and-test:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
services:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: test_db
MYSQL_ROOT_PASSWORD: admin123
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 3
ports:
- 3306:3306
# Env setup for tests - not deployment
env:
APP_PORT: 3000
APP_URL: http://localhost:9000
APP_NAME: Test App
DATABASE_URL: mysql://root:admin123@localhost:3306/test_db
TMP_DIR: tests/tmp/storage/tmp/
UPLOAD_DIR: tests/tmp/storage/uploads/
STORAGE_LOCATION: local
JWT_SECRET: aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpP
SMTP_HOST: localhost
SMTP_PORT: 587
SMTP_USERNAME: user
SMTP_PASSWORD: password
EMAIL_FROM: [email protected]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Build workspaces
run: npm run build --workspaces
- name: Migrate test database
run: npm run migrate --workspaces --if-present
- name: Test workspaces
run: npm run test --workspaces --if-present