frontend-commons/.github/workflows/lint.yaml
Workflow config file is invalid. Please check your config file: yaml: line 66: mapping values are not allowed in this context
2025-10-23 10:03:20 +02:00

105 lines
3.8 KiB
YAML

name: Linting and type checking (standalone)
on:
workflow_call:
inputs:
SONARQUBE_ENABLED:
required: false
type: boolean
default: false
TESTS_ENABLED:
required: false
type: boolean
default: false
SETUP_REPO_SCRIPT:
required: false
type: string
default: yarn run setup
TEST_SCRIPT:
required: false
type: string
default: yarn run test
LINT_SCRIPT:
required: false
type: string
default: yarn run lint
CHECK_TYPES_SCRIPT:
required: false
type: string
default: yarn run check-types
INSTALL_SCRIPT:
required: false
type: string
default: yarn install --immutable --inline-builds
NODE_VERSION:
required: false
type: string
default: "24"
jobs:
linting_type_checking:
runs-on: ubuntu-latest
env:
NO_YARN_POSTINSTALL: 1
FONTAWESOME_PACKAGE_TOKEN: ${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Node.js and Corepack
uses: actions/setup-node@v6
with:
node-version: ${{ inputs.NODE_VERSION }}
- name: Enable Corepack
run: |
corepack enable
- name: Install dependencies
run: |
echo "-----------------------------------------------------------------------------------------------------"
echo "Install dependencies"
echo script: "${{ inputs.INSTALL_SCRIPT }}"
echo "-----------------------------------------------------------------------------------------------------"
${{ inputs.INSTALL_SCRIPT }}
- name: Setup repostitory
run: |
echo "-----------------------------------------------------------------------------------------------------"
echo "Setup repostitory"
echo script: "${{ inputs.SETUP_REPO_SCRIPT }}"
echo "-----------------------------------------------------------------------------------------------------"
${{ inputs.SETUP_REPO_SCRIPT }}
- name: Lint source code (eslint)
run: |
echo "-----------------------------------------------------------------------------------------------------"
echo "Lint source code (eslint)"
echo script: "${{ inputs.LINT_SCRIPT }}"
echo "-----------------------------------------------------------------------------------------------------"
${{ inputs.LINT_SCRIPT }}
- name: Static type checking (TypeScript)
run: |
echo "-----------------------------------------------------------------------------------------------------"
echo "Static type checking (TypeScript)"
echo script: "${{ inputs.CHECK_TYPES_SCRIPT }}"
echo "-----------------------------------------------------------------------------------------------------"
${{ inputs.CHECK_TYPES_SCRIPT }}
- name: Run tests
if: ${{ inputs.TESTS_ENABLED == true }}
run: |
echo "-----------------------------------------------------------------------------------------------------"
echo "Run tests"
echo script: "${{ inputs.TEST_SCRIPT }}"
echo "-----------------------------------------------------------------------------------------------------"
${{ inputs.TEST_SCRIPT }}
- name: Static code analysis with SonarQube
uses: https://github.com/SonarSource/sonarqube-scan-action@v6
if: ${{ inputs.SONARQUBE_ENABLED == true }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
# TODO add dependency scanning / graph here