2022-05-03 21:45:37 +02:00
|
|
|
name: Lint
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- 'l10n_master'
|
2022-06-20 21:16:51 +02:00
|
|
|
- 'cf-pages'
|
2022-05-03 21:45:37 +02:00
|
|
|
paths-ignore:
|
|
|
|
- '.github/workflows/**'
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs: {}
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
name: Lint
|
2024-02-08 21:56:39 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2022-05-03 21:45:37 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
|
2022-05-03 21:45:37 +02:00
|
|
|
|
2022-10-18 10:05:33 +02:00
|
|
|
- name: Lint filenames (no capital characters)
|
|
|
|
run: |
|
2022-11-10 15:08:04 +01:00
|
|
|
find . -type f,d -name "*[[:upper:]]*" \
|
2022-10-18 10:05:33 +02:00
|
|
|
! -path "./node_modules/*" \
|
|
|
|
! -path "./coverage/*" \
|
|
|
|
! -path "*/dist/*" \
|
|
|
|
! -path "*/build/*" \
|
|
|
|
! -path "*/target/*" \
|
|
|
|
! -path "./.git/*" \
|
|
|
|
! -path "*/.DS_Store" \
|
2022-11-10 15:08:04 +01:00
|
|
|
! -path "*/*locales/*" \
|
|
|
|
! -path "./.github/*" \
|
2024-07-01 15:19:29 +02:00
|
|
|
! -path "*/Cargo.toml" \
|
|
|
|
! -path "*/Cargo.lock" \
|
2022-10-18 10:05:33 +02:00
|
|
|
> tmp.txt
|
|
|
|
diff <(sort .github/whitelist-capital-letters.txt) <(sort tmp.txt)
|
|
|
|
|
2023-10-04 18:23:40 +02:00
|
|
|
- name: Get Node Version
|
|
|
|
id: retrieve-node-version
|
|
|
|
run: |
|
|
|
|
NODE_NVMRC=$(cat .nvmrc)
|
|
|
|
NODE_VERSION=${NODE_NVMRC/v/''}
|
|
|
|
echo "node_version=$NODE_VERSION" >> $GITHUB_OUTPUT
|
|
|
|
|
2022-05-03 21:45:37 +02:00
|
|
|
- name: Set up Node
|
2024-09-24 17:35:01 +02:00
|
|
|
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
|
2022-05-03 21:45:37 +02:00
|
|
|
with:
|
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: '**/package-lock.json'
|
2023-10-04 18:23:40 +02:00
|
|
|
node-version: ${{ steps.retrieve-node-version.outputs.node_version }}
|
2022-05-03 21:45:37 +02:00
|
|
|
|
|
|
|
- name: Run linter
|
|
|
|
run: |
|
|
|
|
npm ci
|
|
|
|
npm run lint
|