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