diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index df272da..4f557bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,11 +8,43 @@ on: 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 + + services: + maria: + 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 @@ -35,3 +67,20 @@ jobs: - name: Typecheck uses: andoshin11/typescript-error-reporter-action@v1.0.2 + - name: PostgreSQL Migrations + run: yarn typeorm migration:run + env: + DATABASE_DRIVER: postgres + DATABASE_URL: postgresql://root@127.0.0.1:5432/ohmyform + + - name: MariaDB Migrations + run: yarn typeorm migration:run + env: + DATABASE_DRIVER: mariadb + DATABASE_URL: mysql://root@127.0.0.1:3306/ohmyform + + - name: SQLite Migrations + run: yarn typeorm migration:run + env: + DATABASE_DRIVER: sqlite + DATABASE_URL: sqlite://data.sqlite diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4c8407b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ -language: node_js - -services: - - mysql - - mysql - - postgresql - -before_install: - - mysql -e 'CREATE DATABASE ohmyform;' - - psql -c 'create database ohmyform;' -U root - -env: - global: - - CREATE_ADMIN=true - - ADMIN_EMAIL=admin@localhost - - ADMIN_USERNAME=admin - - ADMIN_PASSWORD=admin - - MAILER_URI=smtp://localhost:1025 - jobs: - - DATABASE_DRIVER=mariadb DATABASE_URL=mysql://root@127.0.0.1:3306/ohmyform - - DATABASE_DRIVER=postgres DATABASE_URL=postgresql://root@127.0.0.1:5432/ohmyform - - DATABASE_DRIVER=sqlite DATABASE_URL=sqlite:// - -node_js: - - 16 - #- 14 - #- 12 - -cache: - yarn: true - -install: - #- rm yarn.lock - - yarn install - -script: - - yarn lint - - yarn test - - yarn build - - yarn typeorm migration:run