hedgedoc/.github/workflows/backend-tests.yml
Tilman Vatteroth bf30cbcf48 fix(repository): Move backend code into subdirectory
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-10-30 22:46:42 +01:00

67 lines
1.6 KiB
YAML

# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
#
# SPDX-License-Identifier: AGPL-3.0-only
name: Backend / Lint and Test
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
env:
NODEJS_VERSION: 18
defaults:
run:
working-directory: backend
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.NODEJS_VERSION }}
uses: actions/setup-node@v3
with:
cache-dependency-path: backend/yarn.lock
node-version: ${{ env.NODEJS_VERSION }}
cache: 'yarn'
- run: yarn install --immutable
- run: yarn run lint
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 14.x, 16.x, 18.x ]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache-dependency-path: backend/yarn.lock
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn install --immutable
- run: yarn run build
integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js ${{ env.NODEJS_VERSION }}
uses: actions/setup-node@v3
with:
cache-dependency-path: backend/yarn.lock
node-version: ${{ env.NODEJS_VERSION }}
cache: 'yarn'
- run: yarn install --immutable
- run: yarn run test:cov
- uses: codecov/codecov-action@v3
with:
directory: backend/coverage
flags: integration-tests