136 lines
3.7 KiB
YAML
136 lines
3.7 KiB
YAML
name: Lint
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
env:
|
|
CREATE_ADMIN: true
|
|
ADMIN_EMAIL: admin@localhost
|
|
ADMIN_USERNAME: admin
|
|
ADMIN_PASSWORD: admin
|
|
MAILER_URI: smtp://localhost:1025
|
|
|
|
jobs:
|
|
run-linters:
|
|
name: Run linters
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 16
|
|
|
|
# ESLint and Prettier must be in `package.json`
|
|
- name: Install Node.js dependencies
|
|
run: yarn install --frozen-lockfile --silent
|
|
|
|
- name: Lint
|
|
uses: reviewdog/action-eslint@v1
|
|
with:
|
|
reporter: github-pr-review # Change reporter.
|
|
eslint_flags: '{src,test}/**/*.ts'
|
|
|
|
- name: Typecheck
|
|
uses: andoshin11/typescript-error-reporter-action@v1.0.2
|
|
|
|
run-migrations:
|
|
name: Run Migrations
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
mariadb:
|
|
image: mariadb
|
|
env:
|
|
MYSQL_ROOT_PASSWORD: root
|
|
MYSQL_DATABASE: ohmyform
|
|
options: >-
|
|
--health-cmd "mysqladmin ping"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
|
|
postgres:
|
|
image: postgres:10-alpine
|
|
env:
|
|
POSTGRES_USER: root
|
|
POSTGRES_PASSWORD: root
|
|
POSTGRES_DB: ohmyform
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 16
|
|
|
|
- name: Install Node.js dependencies
|
|
run: yarn install --frozen-lockfile --silent
|
|
|
|
- name: PostgreSQL Migrations
|
|
run: yarn typeorm:postgres migration:run
|
|
env:
|
|
DATABASE_DRIVER: postgres
|
|
|
|
TYPEORM_CONNECTION: postgres
|
|
TYPEORM_HOST: postgres
|
|
TYPEORM_PORT: 5432
|
|
TYPEORM_USERNAME: root
|
|
TYPEORM_DATABASE: ohmyform
|
|
TYPEORM_AUTO_SCHEMA_SYNC: false
|
|
TYPEORM_ENTITIES: src/entity/**/*.ts
|
|
TYPEORM_SUBSCRIBERS: src/subscriber/**/*.ts
|
|
TYPEORM_MIGRATIONS: src/migrations/postgres/**/*.ts
|
|
TYPEORM_ENTITIES_DIR: src/entity
|
|
TYPEORM_MIGRATIONS_DIR: src/migrations/postgres
|
|
TYPEORM_SUBSCRIBERS_DIR: src/subscriber
|
|
|
|
- name: MariaDB Migrations
|
|
run: yarn typeorm:mariadb migration:run
|
|
env:
|
|
DATABASE_DRIVER: mariadb
|
|
|
|
TYPEORM_CONNECTION: mariadb
|
|
TYPEORM_HOST: mariadb
|
|
TYPEORM_PORT: 3306
|
|
TYPEORM_USERNAME: root
|
|
TYPEORM_DATABASE: ohmyform
|
|
TYPEORM_AUTO_SCHEMA_SYNC: false
|
|
TYPEORM_ENTITIES: src/entity/**/*.ts
|
|
TYPEORM_SUBSCRIBERS: src/subscriber/**/*.ts
|
|
TYPEORM_MIGRATIONS: src/migrations/mariadb/**/*.ts
|
|
TYPEORM_ENTITIES_DIR: src/entity
|
|
TYPEORM_MIGRATIONS_DIR: src/migrations/mariadb
|
|
TYPEORM_SUBSCRIBERS_DIR: src/subscriber
|
|
|
|
- name: SQLite Migrations
|
|
run: yarn typeorm:sqlite migration:run
|
|
env:
|
|
DATABASE_DRIVER: sqlite
|
|
|
|
TYPEORM_CONNECTION: sqlite
|
|
TYPEORM_USERNAME: root
|
|
TYPEORM_DATABASE: data.sqlite
|
|
TYPEORM_AUTO_SCHEMA_SYNC: false
|
|
TYPEORM_ENTITIES: src/entity/**/*.ts
|
|
TYPEORM_SUBSCRIBERS: src/subscriber/**/*.ts
|
|
TYPEORM_MIGRATIONS: src/migrations/sqlite/**/*.ts
|
|
TYPEORM_ENTITIES_DIR: src/entity
|
|
TYPEORM_MIGRATIONS_DIR: src/migrations/sqlite
|
|
TYPEORM_SUBSCRIBERS_DIR: src/subscriber
|