2023-02-24 14:52:49 +00:00
|
|
|
name: lint
|
2023-03-06 01:12:46 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
|
2023-02-24 14:52:49 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
brightscript:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- uses: actions/setup-node@master
|
|
|
|
with:
|
|
|
|
node-version: "lts/*"
|
|
|
|
cache: "npm"
|
|
|
|
- run: npm ci
|
|
|
|
- run: npx ropm install
|
|
|
|
- run: npm run validate
|
|
|
|
- run: npm run check-formatting
|
|
|
|
translation-files:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Clone github repo
|
|
|
|
uses: actions/checkout@master
|
|
|
|
- name: Install xmllint and xmlstarlet using apt (from cache)
|
|
|
|
uses: awalsh128/cache-apt-pkgs-action@latest
|
|
|
|
with:
|
|
|
|
packages: libxml2-utils xmlstarlet
|
|
|
|
- name: Validate XML syntax
|
2023-03-15 22:02:01 +00:00
|
|
|
run: xmllint --noout ./locale/en_US/translations.ts
|
|
|
|
- name: Save output of duplicate check
|
|
|
|
run: echo "tsDuplicates=$(xmlstarlet sel -t -m '/TS/context/message/source' -c '.' -nl ./locale/en_US/translations.ts | sort | uniq -d | awk '{ printf "%s", $0 }')" >> $GITHUB_ENV
|
|
|
|
- name: Check for duplicates
|
|
|
|
run: xmlstarlet sel -t -m '/TS/context/message/source' -f -o ' ' -c '.' -nl ./locale/en_US/translations.ts | sort | uniq -d
|
|
|
|
- name: Duplicates found
|
|
|
|
if: env.tsDuplicates != ''
|
|
|
|
run: exit 1
|
2023-02-25 02:16:48 +00:00
|
|
|
json:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Clone github repo
|
|
|
|
uses: actions/checkout@master
|
|
|
|
- uses: actions/setup-node@master
|
|
|
|
with:
|
|
|
|
node-version: "lts/*"
|
|
|
|
cache: "npm"
|
|
|
|
- name: Install npm dependencies
|
|
|
|
run: npm ci
|
|
|
|
- name: Install roku package dependencies
|
|
|
|
run: npx ropm install
|
|
|
|
- name: Validate JSON syntax
|
|
|
|
run: npm run lint-json
|
|
|
|
markdown:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Clone github repo
|
|
|
|
uses: actions/checkout@master
|
|
|
|
- uses: actions/setup-node@master
|
|
|
|
with:
|
|
|
|
node-version: "lts/*"
|
|
|
|
cache: "npm"
|
|
|
|
- name: Install npm dependencies
|
|
|
|
run: npm ci
|
|
|
|
- name: Install roku package dependencies
|
|
|
|
run: npx ropm install
|
2023-02-25 15:18:13 +00:00
|
|
|
- uses: xt0rted/markdownlint-problem-matcher@98d94724052d20ca2e06c091f202e4c66c3c59fb # v2
|
2023-02-25 02:16:48 +00:00
|
|
|
- name: Lint markdown files
|
2023-02-26 18:52:06 +00:00
|
|
|
run: npm run lint-markdown
|
|
|
|
spelling:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Clone github repo
|
|
|
|
uses: actions/checkout@master
|
|
|
|
- uses: actions/setup-node@master
|
|
|
|
with:
|
|
|
|
node-version: "lts/*"
|
|
|
|
cache: "npm"
|
|
|
|
- name: Install npm dependencies
|
|
|
|
run: npm ci
|
|
|
|
- name: Install roku package dependencies
|
|
|
|
run: npx ropm install
|
|
|
|
- name: Check markdown files for spelling errors
|
|
|
|
run: npm run lint-spelling
|