-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (63 loc) · 1.83 KB
/
pr.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
# This workflow will:
# 1. Do a clean installation of node dependencies
# 2. Run unit tests
# 3. Build the package
# 4. Scan push/PRs for leaked credentials using TruffleHog
name: PR workflow
on:
pull_request:
branches: ['main']
jobs:
build:
name: Setup & build
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Use Node version from .nvmrc
uses: actions/setup-node@v3
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}
- name: Install dependencies
uses: pnpm/action-setup@v2
with:
version: 8
run_install: true
- name: Build the package
run: pnpm run build
run-unit-tests:
name: Test on Node ${{ matrix.node_version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16, 18] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
uses: pnpm/action-setup@v2
with:
version: 8
run_install: true
- name: Run unit tests (with experimental VM modules)
run: pnpm run test
trufflehog:
name: TruffleHog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@main
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD
extra_args: --debug --only-verified