-
-
Notifications
You must be signed in to change notification settings - Fork 157
57 lines (46 loc) · 1.88 KB
/
lint-and-syntax-check.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
name: Lint and Syntax Check
on:
push:
branches:
# Only run on branch push, not tag push
- '**'
pull_request:
jobs:
lint:
# Run for external PRs, but not on our own internal PRs as they'll be run by the push to the branch.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'DoctorMcKay/node-steam-user'
uses: DoctorMcKay/github-workflows/.github/workflows/eslint.yml@master
with:
node-version: 14.x
syntax-check:
# Run for external PRs, but not on our own internal PRs as they'll be run by the push to the branch.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'DoctorMcKay/node-steam-user'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 14.x, 16.x, 18.x, 20.x ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Cache dependencies
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node_modules
- name: npm install
run: npm install
- name: Syntax check
run: node index.js
publish:
needs: [ lint, syntax-check ]
if: success() && github.event.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '#npm-publish')
uses: DoctorMcKay/github-workflows/.github/workflows/npm-publish.yml@master
with:
node-version: 14.x
secrets:
npm-access-token: ${{ secrets.NPM_ACCESS_TOKEN }}