jellyfin-web/.github/workflows/lint.yml

120 lines
3.0 KiB
YAML
Raw Normal View History

2020-11-24 13:22:00 -07:00
name: Lint
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
run-eslint:
name: Run eslint
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
2021-03-01 16:28:44 -07:00
- name: Setup node environment
uses: actions/setup-node@v2.1.5
2020-11-24 13:22:00 -07:00
with:
node-version: 12
2021-03-01 16:28:44 -07:00
check-latest: true
2020-11-24 13:22:00 -07:00
2021-03-01 16:28:44 -07:00
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node_modules
uses: actions/cache@v2.1.4
id: npm-cache
with:
2021-03-01 16:28:44 -07:00
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
2020-11-24 13:22:00 -07:00
- name: Install Node.js dependencies
2021-03-01 16:28:44 -07:00
run: npm ci --no-audit
2020-11-24 13:22:00 -07:00
env:
SKIP_PREPARE: true
- name: Run eslint
2021-03-01 16:28:44 -07:00
run: npm run lint
2020-11-24 13:22:00 -07:00
2020-11-30 07:59:30 -07:00
run-stylelint-css:
name: Run stylelint (css)
2020-11-24 13:22:00 -07:00
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
2021-03-01 16:28:44 -07:00
- name: Setup node environment
uses: actions/setup-node@v2.1.5
2020-11-24 13:22:00 -07:00
with:
node-version: 12
2021-03-01 16:28:44 -07:00
check-latest: true
2020-11-24 13:22:00 -07:00
2021-03-01 16:28:44 -07:00
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm config get cache)"
2020-11-30 08:30:45 -07:00
2021-03-01 16:28:44 -07:00
- name: Cache node_modules
uses: actions/cache@v2.1.4
id: npm-cache
with:
2021-03-01 16:28:44 -07:00
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Set up stylelint matcher
uses: xt0rted/stylelint-problem-matcher@v1
2020-11-24 13:22:00 -07:00
- name: Install Node.js dependencies
2021-03-01 16:28:44 -07:00
run: npm ci --no-audit
2020-11-24 13:22:00 -07:00
env:
SKIP_PREPARE: true
- name: Run stylelint
2021-03-01 16:28:44 -07:00
run: npm run stylelint:css
2020-11-30 07:59:30 -07:00
run-stylelint-scss:
name: Run stylelint (scss)
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
2021-03-01 16:28:44 -07:00
- name: Setup node environment
uses: actions/setup-node@v2.1.5
2020-11-30 07:59:30 -07:00
with:
node-version: 12
2021-03-01 16:28:44 -07:00
check-latest: true
2020-11-30 07:59:30 -07:00
2021-03-01 16:28:44 -07:00
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm config get cache)"
2020-11-30 08:30:45 -07:00
2021-03-01 16:28:44 -07:00
- name: Cache node_modules
uses: actions/cache@v2.1.4
id: npm-cache
with:
2021-03-01 16:28:44 -07:00
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Set up stylelint matcher
uses: xt0rted/stylelint-problem-matcher@v1
2020-11-30 07:59:30 -07:00
- name: Install Node.js dependencies
2021-03-01 16:28:44 -07:00
run: npm ci --no-audit
2020-11-30 07:59:30 -07:00
env:
SKIP_PREPARE: true
- name: Run stylelint
2021-03-01 16:28:44 -07:00
run: npm run stylelint:scss