2021-04-08 02:15:11 +02:00
|
|
|
name: Verify Source
|
2020-11-28 12:34:36 +02:00
|
|
|
on: [pull_request, push]
|
|
|
|
|
|
|
|
jobs:
|
2021-05-29 18:00:40 +02:00
|
|
|
build:
|
|
|
|
name: Build package
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-22 08:03:01 +02:00
|
|
|
uses: actions/checkout@v4
|
2024-05-02 23:24:43 +02:00
|
|
|
- name: Use Node.js
|
2024-03-09 18:28:21 +02:00
|
|
|
uses: actions/setup-node@v4
|
2021-05-29 18:00:40 +02:00
|
|
|
with:
|
2024-05-02 23:24:43 +02:00
|
|
|
node-version: 22
|
2024-03-09 18:28:21 +02:00
|
|
|
cache: npm
|
|
|
|
cache-dependency-path: '**/package.json'
|
2021-05-29 18:00:40 +02:00
|
|
|
- name: Install dependencies
|
2024-03-18 23:27:08 +02:00
|
|
|
run: npm i --ignore-scripts --no-audit --no-fund
|
2021-05-29 18:00:40 +02:00
|
|
|
- name: Build NodeJS package
|
|
|
|
run: npm run build
|
2020-11-28 12:34:36 +02:00
|
|
|
lint:
|
|
|
|
name: Lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Checkout
|
2023-09-22 08:03:01 +02:00
|
|
|
uses: actions/checkout@v4
|
2024-05-02 23:24:43 +02:00
|
|
|
- name: Use Node.js
|
2024-03-09 18:28:21 +02:00
|
|
|
uses: actions/setup-node@v4
|
2021-06-29 12:07:50 +02:00
|
|
|
with:
|
2024-05-02 23:24:43 +02:00
|
|
|
node-version: 22
|
2024-03-09 18:28:21 +02:00
|
|
|
cache: npm
|
|
|
|
cache-dependency-path: '**/package.json'
|
2024-03-09 18:36:18 +02:00
|
|
|
- name: Detect changed files
|
2024-03-09 18:28:21 +02:00
|
|
|
uses: dorny/paths-filter@v3
|
2023-08-10 17:25:53 +02:00
|
|
|
id: changes
|
|
|
|
with:
|
|
|
|
list-files: shell
|
|
|
|
filters: |
|
|
|
|
docs:
|
|
|
|
- '*.md'
|
|
|
|
- '.github/**.md'
|
2024-03-09 18:36:18 +02:00
|
|
|
icons:
|
|
|
|
- 'icons/*.svg'
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install dependencies
|
2024-03-18 23:27:08 +02:00
|
|
|
run: npm i --ignore-scripts --no-audit --no-fund
|
2024-03-09 18:36:18 +02:00
|
|
|
- name: Run linter
|
2024-03-29 18:06:38 +02:00
|
|
|
run: |
|
|
|
|
sed -i 's/icons\/\*\.svg/$npm_config_icons/' package.json
|
|
|
|
npm run lint --icons='${{ steps.changes.outputs.icons_files }}'
|
2024-03-09 18:36:18 +02:00
|
|
|
env:
|
|
|
|
# Authorise GitHub API requests for editorconfig-checker
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-08-10 17:25:53 +02:00
|
|
|
- name: Check documentation links
|
2024-03-09 18:36:18 +02:00
|
|
|
if: steps.changes.outputs.docs == true
|
2023-08-10 17:25:53 +02:00
|
|
|
run: |
|
|
|
|
npx markdown-link-check --retry \
|
2023-09-01 16:37:14 +02:00
|
|
|
--config .github/markdown-link-check.json \
|
2023-08-10 17:25:53 +02:00
|
|
|
${{ steps.changes.outputs.docs_files }}
|
|
|
|
continue-on-error: ${{ github.ref == 'refs/heads/develop' }}
|
2021-08-04 10:23:20 +02:00
|
|
|
- name: Verify file permissions
|
|
|
|
run: |
|
|
|
|
CHECK_DIRS="icons/ _data/"
|
|
|
|
echo "Searching the following directories for executable files:"
|
|
|
|
echo "${CHECK_DIRS}"
|
|
|
|
echo ""
|
|
|
|
EXE_FILES=$(find ${CHECK_DIRS} -type f -executable)
|
|
|
|
if test -n "${EXE_FILES-}"
|
|
|
|
then
|
|
|
|
echo "Some files were detected to have their executable bit set."
|
|
|
|
echo "To fix this, you can use 'chmod -x PATH/TO/FILE' on the following files:"
|
|
|
|
echo ""
|
|
|
|
echo "${EXE_FILES}"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "All clear."
|
|
|
|
exit 0
|
|
|
|
fi
|
2020-11-28 12:34:36 +02:00
|
|
|
test:
|
|
|
|
name: Test package
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Checkout
|
2023-09-22 08:03:01 +02:00
|
|
|
uses: actions/checkout@v4
|
2024-05-02 23:24:43 +02:00
|
|
|
- name: Use Node.js
|
2024-03-09 18:28:21 +02:00
|
|
|
uses: actions/setup-node@v4
|
2021-06-29 12:07:50 +02:00
|
|
|
with:
|
2024-05-02 23:24:43 +02:00
|
|
|
node-version: 22
|
2024-03-09 18:28:21 +02:00
|
|
|
cache: npm
|
|
|
|
cache-dependency-path: '**/package.json'
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Install dependencies
|
2024-03-18 23:27:08 +02:00
|
|
|
run: npm i --ignore-scripts --no-audit --no-fund
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Run tests
|
|
|
|
run: npm run test
|