-
Notifications
You must be signed in to change notification settings - Fork 7
50 lines (42 loc) · 1.08 KB
/
test.yml
File metadata and controls
50 lines (42 loc) · 1.08 KB
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
name: CI
on:
push:
branches: ["*"]
tags-ignore: ["*"]
pull_request:
branches: [main]
workflow_call:
secrets:
SOCKET_API_KEY:
required: false
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Bun
uses: oven-sh/setup-bun@22457c87c1b161cf7dde222c3e82b2b5f8d2bed2
- name: Install dependencies
run: bun install
- name: Run tests
run: bun test
env:
SOCKET_API_KEY: ${{ secrets.SOCKET_API_KEY }}
- name: Test blocking on install
shell: bash
run: |
if bun add lodahs; then
echo "ERROR: Scanner failed to block malicious package"
exit 1
else
echo "SUCCESS: Scanner blocked malicious package as expected"
exit 0
fi