mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
148 lines
3.6 KiB
YAML
148 lines
3.6 KiB
YAML
name: Run tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- develop
|
|
- 'feature/**'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout source
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Detect changed files
|
|
uses: tj-actions/changed-files@v34
|
|
with:
|
|
files: |
|
|
e2e-tests/mysql-ssh/Dockerfile
|
|
|
|
- name: Build mysql-ssh image
|
|
if: ${{ steps.filecheck.outputs.any_changed == 'true' }}
|
|
run: |
|
|
docker build -t dbgate/mysql-ssh:latest e2e-tests/mysql-ssh
|
|
|
|
- name: Log in to GHCR
|
|
if: ${{ steps.filecheck.outputs.any_changed == 'true' }}
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Push image to GHCR
|
|
if: ${{ steps.filecheck.outputs.any_changed == 'true' }}
|
|
run: |
|
|
docker tag dbgate/mysql-ssh:latest ghcr.io/dbgate/mysql-ssh:latest
|
|
docker push ghcr.io/dbgate/mysql-ssh:latest
|
|
|
|
test:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
container: node:18
|
|
|
|
steps:
|
|
- name: Install dependencies for cypress
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y xvfb libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6
|
|
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: yarn install
|
|
run: |
|
|
yarn install
|
|
|
|
- name: Build packer dist for cypress
|
|
run: |
|
|
yarn prepare:packer
|
|
|
|
- name: yarn install cypress
|
|
run: |
|
|
cd e2e-tests
|
|
yarn install
|
|
|
|
- name: Run Cypress tests
|
|
run: |
|
|
cd e2e-tests
|
|
yarn test:ci
|
|
|
|
- name: Integration tests
|
|
run: |
|
|
cd integration-tests
|
|
yarn test:ci
|
|
|
|
- name: Filter parser tests
|
|
if: always()
|
|
run: |
|
|
cd packages/filterparser
|
|
yarn test:ci
|
|
|
|
- name: Datalib (perspective) tests
|
|
if: always()
|
|
run: |
|
|
cd packages/datalib
|
|
yarn test:ci
|
|
|
|
- uses: tanmen/jest-reporter@v1
|
|
if: always()
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
result-file: integration-tests/result.json
|
|
action-name: Integration tests
|
|
|
|
- uses: tanmen/jest-reporter@v1
|
|
if: always()
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
result-file: packages/filterparser/result.json
|
|
action-name: Filter parser test results
|
|
|
|
- uses: tanmen/jest-reporter@v1
|
|
if: always()
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
result-file: packages/datalib/result.json
|
|
action-name: Datalib (perspectives) test results
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres
|
|
env:
|
|
POSTGRES_PASSWORD: Pwd2020Db
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
|
|
mysql:
|
|
image: mysql:8.0.18
|
|
env:
|
|
MYSQL_ROOT_PASSWORD: Pwd2020Db
|
|
|
|
mssql:
|
|
image: mcr.microsoft.com/mssql/server
|
|
env:
|
|
ACCEPT_EULA: Y
|
|
SA_PASSWORD: Pwd2020Db
|
|
MSSQL_PID: Express
|
|
|
|
clickhouse:
|
|
image: bitnami/clickhouse:24.8.4
|
|
env:
|
|
CLICKHOUSE_ADMIN_PASSWORD: Pwd2020Db
|
|
|
|
oracle:
|
|
image: gvenzl/oracle-xe:21-slim
|
|
env:
|
|
ORACLE_PASSWORD: Pwd2020Db
|
|
|
|
mysql-ssh:
|
|
image: ghcr.io/dbgate/mysql-ssh:latest
|