2021-01-06 20:36:07 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
2021-01-05 22:02:12 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
|
|
|
|
name: Nest.JS CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ develop ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ develop ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
command:
|
|
|
|
- yarn run lint
|
|
|
|
- yarn run format:check
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js 14
|
2021-01-06 22:40:22 +00:00
|
|
|
uses: actions/setup-node@v2
|
2021-01-05 22:02:12 +00:00
|
|
|
with:
|
|
|
|
node-version: 14
|
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: yarn-cache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-yarn-
|
|
|
|
- run: yarn --frozen-lockfile --prefer-offline
|
|
|
|
- run: ${{matrix.command}}
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [ 10.x, 12.x, 14.x, 15.x ]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2021-01-06 22:40:22 +00:00
|
|
|
uses: actions/setup-node@v2
|
2021-01-05 22:02:12 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: yarn-cache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-yarn-
|
|
|
|
- run: yarn --frozen-lockfile --prefer-offline
|
|
|
|
- run: yarn run build
|
|
|
|
|
|
|
|
integration-tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-01-06 12:17:30 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-01-05 22:02:12 +00:00
|
|
|
- name: Use Node.js 14
|
2021-01-06 22:40:22 +00:00
|
|
|
uses: actions/setup-node@v2
|
2021-01-05 22:02:12 +00:00
|
|
|
with:
|
|
|
|
node-version: 14
|
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: yarn-cache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-yarn-
|
|
|
|
- run: yarn --frozen-lockfile --prefer-offline
|
2021-01-06 11:38:33 +00:00
|
|
|
- run: yarn run test:cov
|
|
|
|
- uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
directory: coverage
|
|
|
|
flags: integration-tests
|
2021-01-05 22:02:12 +00:00
|
|
|
|
|
|
|
e2e-tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-01-06 12:17:30 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-01-05 22:02:12 +00:00
|
|
|
- name: Use Node.js 14
|
2021-01-06 22:40:22 +00:00
|
|
|
uses: actions/setup-node@v2
|
2021-01-05 22:02:12 +00:00
|
|
|
with:
|
|
|
|
node-version: 14
|
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: yarn-cache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-yarn-
|
|
|
|
- run: yarn --frozen-lockfile --prefer-offline
|
2021-01-06 11:38:33 +00:00
|
|
|
- run: yarn run test:e2e:cov
|
|
|
|
- uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
directory: coverage-e2e
|
|
|
|
flags: e2e-tests
|