2021-01-06 15:37:59 -05:00
|
|
|
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
2020-11-22 15:50:07 -05:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-08-31 06:48:58 -04:00
|
|
|
name: test, build
|
2020-05-27 09:43:28 -04:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-08-15 10:17:06 -04:00
|
|
|
branches: [main]
|
2020-05-27 09:43:28 -04:00
|
|
|
pull_request:
|
2020-08-15 10:17:06 -04:00
|
|
|
branches: [main]
|
2020-05-27 09:43:28 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2020-06-06 18:02:50 -04:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-08-27 08:34:10 -04:00
|
|
|
node: ['12', '14']
|
2020-08-31 06:48:58 -04:00
|
|
|
name: Test and build with NodeJS ${{ matrix.node }}
|
2020-05-27 09:43:28 -04:00
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
2020-11-29 04:07:44 -05:00
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
2020-05-27 09:43:28 -04:00
|
|
|
- name: Cache node_modules
|
2020-11-29 04:07:44 -05:00
|
|
|
uses: actions/cache@v2
|
|
|
|
id: yarn-cache
|
2020-05-27 09:43:28 -04:00
|
|
|
with:
|
2020-11-29 04:07:44 -05:00
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-yarn-
|
2020-06-06 18:02:50 -04:00
|
|
|
- name: Set up NodeJS
|
2020-12-18 19:39:40 -05:00
|
|
|
uses: actions/setup-node@v2
|
2020-05-27 09:43:28 -04:00
|
|
|
with:
|
2020-06-06 18:02:50 -04:00
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
- name: Install dependencies
|
2020-11-29 04:07:44 -05:00
|
|
|
run: yarn install --frozen-lockfile --prefer-offline
|
2020-07-18 16:17:36 -04:00
|
|
|
- name: Test Project
|
2020-07-16 05:34:56 -04:00
|
|
|
run: yarn test
|
2020-06-06 18:02:50 -04:00
|
|
|
- name: Build project
|
2020-12-29 11:13:07 -05:00
|
|
|
run: yarn build:production
|