2022-12-11 18:46:30 -05:00
|
|
|
# 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:
|
2023-05-09 05:38:02 -04:00
|
|
|
node: [ '16', '18', '20' ] # Are you changing this? Don't forget to update the min. and recommended node version in getting-started.md!
|
2022-12-11 18:46:30 -05:00
|
|
|
include:
|
2023-05-09 05:38:02 -04:00
|
|
|
- node: '20'
|
2022-12-11 18:46:30 -05:00
|
|
|
coverage: true
|
|
|
|
name: Test and build with NodeJS ${{ matrix.node }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-08-26 02:43:25 -04:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
2022-12-11 18:46:30 -05:00
|
|
|
|
|
|
|
- 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 coverage
|
|
|
|
if: "${{ matrix.coverage == true }}"
|
2023-05-15 20:31:36 -04:00
|
|
|
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
|
2022-12-11 18:46:30 -05:00
|
|
|
with:
|
|
|
|
directory: backend/coverage
|
|
|
|
flags: integration-tests
|