hedgedoc/.github/workflows/test-and-build.yml
Philip Molares 012e6c3649 ci: add coverage for the frontend
fixes #2945

Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-09-05 18:09:45 +02:00

66 lines
2 KiB
YAML

# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
#
# SPDX-License-Identifier: AGPL-3.0-only
name: Run tests & build
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '16', '18', '20' ] # Are you changing this? Don't forget to update the min. and recommended node version in getting-started.md!
include:
- node: '20'
coverage: true
name: Test and build with NodeJS ${{ matrix.node }}
steps:
- name: Checkout repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Setup node
uses: ./.github/actions/setup-node
with:
NODEJS_VERSION: ${{ matrix.node }}
- name: Build project
run: yarn turbo run build
shell: bash
env:
NODEJS_VERSION: ${{ matrix.node }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_API: ${{ vars.TURBO_API }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
- name: Test Project
run: yarn turbo run test:ci
shell: bash
env:
NODEJS_VERSION: ${{ matrix.node }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_API: ${{ vars.TURBO_API }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
- name: Upload backend coverage
if: "${{ matrix.coverage == true }}"
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
with:
directory: backend/coverage
flags: backend, unit-tests, backend-unit-tests
- name: Upload frontend coverage
if: "${{ matrix.coverage == true }}"
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
with:
directory: frontend/coverage
flags: frontend, unit-tests, frontend-unit-tests