forked from simple-icons/simple-icons
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (98 loc) · 2.92 KB
/
verify.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Verify Source
on:
pull_request:
push:
branches:
- master
- develop
jobs:
build:
name: Build package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.4
cache: npm
cache-dependency-path: '**/package.json'
- name: Install dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Build NodeJS package
run: npm run build
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.4
cache: npm
cache-dependency-path: '**/package.json'
- name: Detect changed files
uses: dorny/paths-filter@v3
id: changes
with:
list-files: shell
filters: |
docs:
- '*.md'
- '.github/**.md'
icons:
- 'icons/*.svg'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Run linter
run: |
sed -i 's/icons\/\*\.svg/$npm_config_icons/' package.json
npm run lint --icons='${{ steps.changes.outputs.icons_files }}'
env:
# Authorise GitHub API requests for editorconfig-checker
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check documentation links
if: steps.changes.outputs.docs == true
run: |
npx markdown-link-check --retry \
--config .github/markdown-link-check.json \
${{ steps.changes.outputs.docs_files }}
continue-on-error: ${{ github.ref == 'refs/heads/develop' }}
- 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@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.4
cache: npm
cache-dependency-path: '**/package.json'
- name: Install dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Run tests
run: npm run test