hedgedoc/.github/workflows/backend-e2e-tests.yml
Tilman Vatteroth 7320fe2ac1 feat(packages): add commons package
This is an import of 166ca8da12
with some changes to make it fit into the mono repo.
- TypedEventEmitter has been replaced with EventEmitter2 because EventEmitter2 is faster and TypedEventEmitter had some troubles with the new way of compiling.
- tsc-esm has been replaced with microbundle. The problems that lib0 doesn't export its types correctly has been solved using yarn patch.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-12-11 23:09:10 +01:00

130 lines
3.3 KiB
YAML

# SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
#
# SPDX-License-Identifier: AGPL-3.0-only
name: Backend / E2E Tests
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
cancel-in-progress: true
env:
NODEJS_VERSION: 18
defaults:
run:
working-directory: backend
jobs:
changes:
name: Check for backend changes
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
changed: ${{ github.event_name == 'push' || steps.changed.outputs.files }}
steps:
- uses: actions/checkout@v3
if: github.event_name != 'push'
- name: Check for backend file changes
if: github.event_name != 'push'
uses: dorny/paths-filter@v2
id: changed
with:
filters: |
files:
- 'commons/**'
- 'backend/**'
- '.github/**'
- '.yarn/**'
sqlite: # This run also collects coverage
needs: changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
if: needs.changes.outputs.changed == 'true'
with:
fetch-depth: 0
- name: Setup node
if: needs.changes.outputs.changed == 'true'
uses: ./.github/actions/setup-node
with:
NODE_VERSION: ${{ env.NODEJS_VERSION }}
- run: yarn run test:e2e:cov
if: needs.changes.outputs.changed == 'true'
- uses: codecov/codecov-action@v3
if: needs.changes.outputs.changed == 'true'
with:
directory: backend/coverage-e2e
flags: e2e-tests
mariadb:
needs: changes
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb
env:
MYSQL_USER: hedgedoc
MYSQL_PASSWORD: hedgedoc
MYSQL_DATABASE: hedgedoc
MYSQL_ROOT_PASSWORD: hedgedoc
options: --health-cmd "mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 5
ports:
- 3306:3306
steps:
- uses: actions/checkout@v3
if: needs.changes.outputs.changed == 'true'
with:
fetch-depth: 0
- name: Setup node
if: needs.changes.outputs.changed == 'true'
uses: ./.github/actions/setup-node
with:
NODE_VERSION: ${{ env.NODEJS_VERSION }}
- run: yarn run test:e2e
if: needs.changes.outputs.changed == 'true'
env:
HEDGEDOC_TEST_DB_TYPE: mariadb
postgres:
needs: changes
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: hedgedoc
POSTGRES_USER: hedgedoc
options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
if: needs.changes.outputs.changed == 'true'
with:
fetch-depth: 0
- name: Setup node
if: needs.changes.outputs.changed == 'true'
uses: ./.github/actions/setup-node
with:
NODE_VERSION: ${{ env.NODEJS_VERSION }}
- run: yarn run test:e2e
if: needs.changes.outputs.changed == 'true'
env:
HEDGEDOC_TEST_DB_TYPE: postgres