Upgrade npm dependencies #4851
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To upgrade pinned actions: Use https://github.com/mheap/pin-github-action | |
name: CI - Frontend | |
on: | |
push: | |
branches-ignore: | |
- "main" | |
- "release/**" | |
paths: | |
- ".github/workflows/frontend.yml" | |
- "panel/**" | |
- "!panel/scripts/**" | |
pull_request: | |
branches-ignore: | |
- "main" | |
- "release/**" | |
paths: | |
- ".github/workflows/frontend.yml" | |
- "panel/**" | |
- "!panel/scripts/**" | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
tests: | |
name: "Unit tests" | |
# run job only under the following conditions: | |
# - can be triggered manually from any repository | |
# - if on pull request, only run if from a fork | |
# (our own repo is covered by the push event) | |
# - if on push, only run CI automatically for the | |
# main getkirby/kirby repo and for forks | |
if: > | |
github.event_name == 'workflow_dispatch' || | |
( | |
github.event_name == 'pull_request' && | |
github.event.pull_request.head.repo.full_name != github.repository | |
) || | |
( | |
github.event_name == 'push' && | |
(github.repository == 'getkirby/kirby' || github.repository_owner != 'getkirby') | |
) | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # pin@v3 | |
- name: Set up Node.js problem matchers and cache npm dependencies | |
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # pin@v3 | |
with: | |
cache: "npm" | |
cache-dependency-path: panel/package-lock.json | |
- name: Install npm dependencies | |
id: finishPrepare | |
run: npm ci | |
working-directory: panel | |
- name: Run JavaScript unit tests | |
if: always() && steps.finishPrepare.outcome == 'success' | |
run: npm run test:unit | |
working-directory: panel | |
coding-style: | |
name: "Coding Style" | |
# run job only under the following conditions: | |
# - can be triggered manually from any repository | |
# - if on pull request, only run if from a fork | |
# (our own repo is covered by the push event) | |
# - if on push, only run CI automatically for the | |
# main getkirby/kirby repo and for forks | |
if: > | |
github.event_name == 'workflow_dispatch' || | |
( | |
github.event_name == 'pull_request' && | |
github.event.pull_request.head.repo.full_name != github.repository | |
) || | |
( | |
github.event_name == 'push' && | |
(github.repository == 'getkirby/kirby' || github.repository_owner != 'getkirby') | |
) | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
env: | |
php: "8.1" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3 | |
- name: Set up Node.js problem matchers and cache npm dependencies | |
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # pin@v3 | |
with: | |
cache: "npm" | |
cache-dependency-path: panel/package-lock.json | |
- name: Install npm dependencies | |
id: finishPrepare | |
run: npm ci | |
working-directory: panel | |
- name: Check for JavaScript coding style violations (ESLint) | |
if: always() && steps.finishPrepare.outcome == 'success' | |
run: npm run lint -- --max-warnings 0 --format stylish --no-fix | |
working-directory: panel | |
- name: Check for JavaScript coding style violations (Prettier) | |
if: always() && steps.finishPrepare.outcome == 'success' | |
run: npm run format --check | |
working-directory: panel |