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
|
2022-05-09 13:17:22 +02:00
|
|
|
uses: actions/checkout@v3
|
2022-02-04 16:24:11 +02:00
|
|
|
- name: Use Node.js 16.x
|
2022-05-09 13:17:22 +02:00
|
|
|
uses: actions/setup-node@v3
|
2021-05-29 18:00:40 +02:00
|
|
|
with:
|
2022-02-04 16:24:11 +02:00
|
|
|
node-version: 16.x
|
2021-06-29 12:07:50 +02:00
|
|
|
- name: Cache dependencies
|
2022-05-09 13:17:22 +02:00
|
|
|
uses: actions/cache@v3
|
2021-06-29 12:07:50 +02:00
|
|
|
with:
|
|
|
|
path: ~/.npm
|
2021-08-23 19:21:03 +02:00
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
2021-06-29 12:07:50 +02:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node-
|
2021-05-29 18:00:40 +02:00
|
|
|
- name: Install dependencies
|
2021-08-23 19:21:03 +02:00
|
|
|
run: npm i
|
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
|
2022-05-09 13:17:22 +02:00
|
|
|
uses: actions/checkout@v3
|
2022-02-04 16:24:11 +02:00
|
|
|
- name: Use Node.js 16.x
|
2022-05-09 13:17:22 +02:00
|
|
|
uses: actions/setup-node@v3
|
2021-01-15 22:47:00 +02:00
|
|
|
with:
|
2022-02-04 16:24:11 +02:00
|
|
|
node-version: 16.x
|
2021-06-29 12:07:50 +02:00
|
|
|
- name: Cache dependencies
|
2022-05-09 13:17:22 +02:00
|
|
|
uses: actions/cache@v3
|
2021-06-29 12:07:50 +02:00
|
|
|
with:
|
|
|
|
path: ~/.npm
|
2021-08-23 19:21:03 +02:00
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
2021-06-29 12:07:50 +02:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node-
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Install dependencies
|
2021-08-23 19:21:03 +02:00
|
|
|
run: npm i
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Run linter
|
2021-06-29 12:07:50 +02:00
|
|
|
run: npm run lint
|
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
|
2022-05-09 13:17:22 +02:00
|
|
|
uses: actions/checkout@v3
|
2022-02-04 16:24:11 +02:00
|
|
|
- name: Use Node.js 16.x
|
2022-05-09 13:17:22 +02:00
|
|
|
uses: actions/setup-node@v3
|
2021-01-15 22:47:00 +02:00
|
|
|
with:
|
2022-02-04 16:24:11 +02:00
|
|
|
node-version: 16.x
|
2021-06-29 12:07:50 +02:00
|
|
|
- name: Cache dependencies
|
2022-05-09 13:17:22 +02:00
|
|
|
uses: actions/cache@v3
|
2021-06-29 12:07:50 +02:00
|
|
|
with:
|
|
|
|
path: ~/.npm
|
2021-08-23 19:21:03 +02:00
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
2021-06-29 12:07:50 +02:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node-
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Install dependencies
|
2021-08-23 19:21:03 +02:00
|
|
|
run: npm i
|
2021-01-15 22:47:00 +02:00
|
|
|
- name: Run tests
|
|
|
|
run: npm run test
|