Skip to content

Commit 52bd193

Browse files
committed
GitHub workflows
1 parent d925baf commit 52bd193

File tree

4 files changed

+127
-0
lines changed

4 files changed

+127
-0
lines changed

.github/workflows/ci.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Continuous integration
2+
3+
on:
4+
push:
5+
branches: [main, develop, feature/**]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test-build:
11+
name: Test & Build
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
matrix:
16+
node-version: [12.22.x, 14.18.x, 16.11.x]
17+
os: [macos-latest, ubuntu-latest, windows-latest]
18+
19+
steps:
20+
- name: Repository checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Run test suite
32+
run: npm test
33+
34+
- name: Build compilation
35+
run: npm run build
36+
37+
- name: Coverage report generation
38+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '16.7.x'
39+
run: npm run coverage
40+
41+
- name: Submit coverage report to provider
42+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '16.7.x'
43+
uses: codecov/codecov-action@v1

.github/workflows/codeql.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: '38 16 * * 2'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [javascript]
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v2
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v1
31+
with:
32+
languages: ${{ matrix.language }}
33+
34+
- name: Autobuild
35+
uses: github/codeql-action/autobuild@v1
36+
37+
- name: Perform CodeQL Analysis
38+
uses: github/codeql-action/analyze@v1

.github/workflows/npm.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: npm
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
build:
9+
name: Publish
10+
if: github.event.pull_request.merged
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: '14.18.x'
17+
registry-url: 'https://registry.npmjs.org'
18+
- run: npm install
19+
- run: npm publish
20+
env:
21+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/snyk.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Snyk
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
analyze:
11+
name: Analyze
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Vulnerability scan
16+
uses: snyk/actions/node@7fad562681122205233d1242c3bb39598c5393da
17+
continue-on-error: true
18+
env:
19+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
20+
with:
21+
args: --sarif-file-output=snyk.sarif
22+
- name: Upload report
23+
uses: github/codeql-action/upload-sarif@v1
24+
with:
25+
sarif_file: snyk.sarif

0 commit comments

Comments
 (0)