hedgedoc/.github/workflows/test-and-build.yml
renovate[bot] e242d5ccf3 chore(deps): update codecov/codecov-action action to v4.0.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-28 22:37:08 +00:00

72 lines
2.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 ]
pull_request_target:
branches: [ develop ]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
cancel-in-progress: true
jobs:
build:
if: "(github.event_name == 'pull_request_target') == github.event.pull_request.head.repo.fork"
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '20' ] # Are you changing this? Don't forget to update the min. and recommended node version in docs/content/how-to/develop/setup.md!
include:
- node: '20'
coverage: true
name: Test and build with NodeJS ${{ matrix.node }}
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup node
uses: ./.github/actions/setup-node
with:
NODEJS_VERSION: ${{ matrix.node }}
- name: Build project
run: yarn 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 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@0cfda1dd0a4ad9efc75517f399d859cd1ea4ced1 # v4.0.2
with:
directory: backend/coverage
flags: backend, unit-tests, backend-unit-tests
- name: Upload frontend coverage
if: "${{ matrix.coverage == true }}"
uses: codecov/codecov-action@0cfda1dd0a4ad9efc75517f399d859cd1ea4ced1 # v4.0.2
with:
directory: frontend/coverage
flags: frontend, unit-tests, frontend-unit-tests