mirror of
https://github.com/Mibew/simple-icons.git
synced 2024-11-15 18:04:12 +03:00
e232399271
* remove jest cache in ci * remove jest cache from publish workflow * remove jest config file and cache from gitignore
86 lines
2.4 KiB
YAML
86 lines
2.4 KiB
YAML
name: Verify Source
|
|
on: [pull_request, push]
|
|
|
|
jobs:
|
|
build:
|
|
name: Build package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Use Node.js 12.x
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 12.x
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
- name: Install dependencies
|
|
run: npm i
|
|
- name: Build NodeJS package
|
|
run: npm run build
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Use Node.js 12.x
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 12.x
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
- name: Install dependencies
|
|
run: npm i
|
|
- name: Run linter
|
|
run: npm run lint
|
|
- 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
|
|
test:
|
|
name: Test package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Use Node.js 12.x
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 12.x
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
- name: Install dependencies
|
|
run: npm i
|
|
- name: Run tests
|
|
run: npm run test
|