Skip to content

1343 category checkboxes #1286

1343 category checkboxes

1343 category checkboxes #1286

# SPDX-FileCopyrightText: 2022 - 2023 Dusan Mijatovic (dv4all)
# SPDX-FileCopyrightText: 2022 - 2023 dv4all
# SPDX-FileCopyrightText: 2023 - 2024 Ewan Cahen (Netherlands eScience Center) <[email protected]>
# SPDX-FileCopyrightText: 2023 - 2024 Netherlands eScience Center
# SPDX-FileCopyrightText: 2023 Dusan Mijatovic (Netherlands eScience Center)
#
# SPDX-License-Identifier: Apache-2.0
name: frontend tests
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "frontend/**"
pull_request:
paths:
- "frontend/**"
jobs:
fe-tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: "install node v20.10 and cache npm"
uses: actions/setup-node@v4
with:
node-version: 20.10
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: "install dependencies"
working-directory: frontend
run: npm ci
- name: "run eslint check"
working-directory: frontend
run: npm run lint
- name: "run unit test"
working-directory: frontend
run: npm run test:coverage
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: SonarCloud Scan frontend
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: frontend
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: "run build test"
working-directory: frontend
run: npm run build