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: lint
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
pull_request:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Lints all .ts and .tsx files
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2022-03-05 15:27:37 +00:00
|
|
|
uses: actions/checkout@v3
|
2020-11-29 09:07:44 +00:00
|
|
|
|
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
2021-12-30 17:45:04 +00:00
|
|
|
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
2020-11-29 09:07:44 +00:00
|
|
|
|
2021-06-21 20:58:54 +00:00
|
|
|
- name: Cache yarn cache
|
2022-04-02 09:07:13 +00:00
|
|
|
uses: actions/cache@v3
|
2020-11-29 09:07:44 +00:00
|
|
|
id: yarn-cache
|
2020-08-31 10:48:58 +00:00
|
|
|
with:
|
2020-11-29 09:07:44 +00:00
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
2022-06-15 18:40:26 +00:00
|
|
|
key: ${{ runner.os }}-18-yarn-${{ hashFiles('**/yarn.lock') }}
|
2020-11-29 09:07:44 +00:00
|
|
|
restore-keys: |
|
2022-06-15 18:40:26 +00:00
|
|
|
${{ runner.os }}-yarn-18
|
2020-11-29 09:07:44 +00:00
|
|
|
|
2020-08-31 10:48:58 +00:00
|
|
|
- name: Set up NodeJS
|
2022-02-26 00:36:32 +00:00
|
|
|
uses: actions/setup-node@v3
|
2020-08-31 10:48:58 +00:00
|
|
|
with:
|
2022-06-15 18:40:26 +00:00
|
|
|
node-version: 18
|
2021-06-06 21:14:00 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2021-12-30 17:45:04 +00:00
|
|
|
run: yarn install --immutable
|
2022-07-02 14:46:43 +00:00
|
|
|
|
2021-06-06 21:14:00 +00:00
|
|
|
- name: Lint code
|
2022-07-02 14:46:43 +00:00
|
|
|
run: yarn lint
|