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-30 16:29:15 +01:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
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" \
|
2024-11-13 15:54:35 +01:00
|
|
|
! -path "./apps/desktop/macos/*" \
|
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-10-30 16:29:15 +01:00
|
|
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
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
|