Skip to content

Commit e445d4b

Browse files
authored
Update CI config (#188)
* update CodeQL workflow * remove git credentials after checkout * switch to Node.js 18 LTS * add `workflow_dispatch`
1 parent cfd8a4c commit e445d4b

3 files changed

Lines changed: 30 additions & 9 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@ name: "CodeQL"
22

33
on:
44
push:
5+
branches:
6+
- main
7+
- "!dependabot/**"
58
pull_request:
9+
branches:
10+
- main
11+
- "!dependabot/**"
612
schedule:
713
- cron: "0 0 * * 0"
14+
workflow_dispatch:
815

916
jobs:
1017
analyze:
@@ -18,11 +25,19 @@ jobs:
1825
steps:
1926
- name: Checkout repository
2027
uses: actions/checkout@v3
28+
with:
29+
persist-credentials: false
2130

2231
- name: Initialize CodeQL
2332
uses: github/codeql-action/init@v2
2433
with:
2534
languages: "javascript"
35+
queries: +security-and-quality
36+
37+
- name: Autobuild
38+
uses: github/codeql-action/autobuild@v2
2639

2740
- name: Perform CodeQL Analysis
2841
uses: github/codeql-action/analyze@v2
42+
with:
43+
category: "/language:javascript"

.github/workflows/lint.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
name: Lint
22

3-
on: [push, pull_request]
3+
on: [push, pull_request, workflow_dispatch]
44

55
env:
66
FORCE_COLOR: 2
7-
NODE: 16
7+
NODE: 18 # The Node.js version to run lint on
88

99
jobs:
10-
lint:
10+
run:
11+
name: Lint
1112
runs-on: ubuntu-latest
1213

1314
steps:
1415
- name: Clone repository
1516
uses: actions/checkout@v3
17+
with:
18+
persist-credentials: false
1619

1720
- name: Set up Node.js
1821
uses: actions/setup-node@v3
1922
with:
20-
node-version: "${{ env.NODE }}"
23+
node-version: ${{ env.NODE }}
2124
cache: npm
2225

2326
- name: Install npm dependencies
2427
run: npm ci
2528

26-
- name: Lint
29+
- name: Run lint
2730
run: npm run lint

.github/workflows/test.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: Tests
22

3-
on: [push, pull_request]
3+
on: [push, pull_request, workflow_dispatch]
44

55
env:
66
FORCE_COLOR: 2
7+
NODE_COV: 18 # The Node.js version to run coveralls on
78

89
jobs:
910
test:
@@ -30,6 +31,8 @@ jobs:
3031
steps:
3132
- name: Clone repository
3233
uses: actions/checkout@v3
34+
with:
35+
persist-credentials: false
3336

3437
- name: Set up Node.js
3538
uses: actions/setup-node@v3
@@ -50,14 +53,14 @@ jobs:
5053

5154
- name: Run full tests
5255
run: npm run test:coverage
53-
if: matrix.os == 'ubuntu-latest'
56+
if: startsWith(matrix.os, 'ubuntu')
5457

5558
- name: Run tests
5659
run: npm run mocha
57-
if: matrix.os == 'windows-latest'
60+
if: startsWith(matrix.os, 'windows')
5861

5962
- name: Run Coveralls
6063
uses: coverallsapp/[email protected]
61-
if: matrix.os == 'ubuntu-latest' && matrix.node == 16
64+
if: startsWith(matrix.os, 'ubuntu') && matrix.node == env.NODE_COV
6265
with:
6366
github-token: "${{ secrets.GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)