-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added github lint and syntax check workflow
- Loading branch information
1 parent
c137d3e
commit 30c67ee
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
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@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
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 | ||
secrets: | ||
npm-access-token: ${{ secrets.NPM_ACCESS_TOKEN }} |