-
Notifications
You must be signed in to change notification settings - Fork 10
109 lines (95 loc) · 3.43 KB
/
e2e-test.yml
File metadata and controls
109 lines (95 loc) · 3.43 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: E2E Test
on:
push:
branches: [main]
pull_request:
jobs:
e2e-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
with:
fetch-depth: 0
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: '3.12'
- name: Install CLI from local repo
run: |
python -m pip install --upgrade pip
pip install .
- name: Run Socket CLI scan
env:
SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_CLI_API_TOKEN }}
run: |
set -o pipefail
socketcli \
--target-path tests/e2e/fixtures/simple-npm \
--disable-blocking \
--enable-debug \
2>&1 | tee /tmp/scan-output.log
- name: Verify scan produced a report
run: |
if grep -q "Full scan report URL: https://socket.dev/" /tmp/scan-output.log; then
echo "PASS: Full scan report URL found"
grep "Full scan report URL:" /tmp/scan-output.log
elif grep -q "Diff Url: https://socket.dev/" /tmp/scan-output.log; then
echo "PASS: Diff URL found"
grep "Diff Url:" /tmp/scan-output.log
else
echo "FAIL: No report URL found in scan output"
cat /tmp/scan-output.log
exit 1
fi
e2e-reachability:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
with:
fetch-depth: 0
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
with:
python-version: '3.12'
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version: '20'
- name: Install CLI from local repo
run: |
python -m pip install --upgrade pip
pip install .
- name: Install uv
run: pip install uv
- name: Run Socket CLI with reachability
env:
SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_CLI_API_TOKEN }}
run: |
set -o pipefail
socketcli \
--target-path tests/e2e/fixtures/simple-npm \
--reach \
--disable-blocking \
--enable-debug \
2>&1 | tee /tmp/reach-output.log
- name: Verify reachability analysis completed
run: |
if grep -q "Reachability analysis completed successfully" /tmp/reach-output.log; then
echo "PASS: Reachability analysis completed"
grep "Reachability analysis completed successfully" /tmp/reach-output.log
grep "Results written to:" /tmp/reach-output.log || true
else
echo "FAIL: Reachability analysis did not complete successfully"
cat /tmp/reach-output.log
exit 1
fi
- name: Verify scan produced a report
run: |
if grep -q "Full scan report URL: https://socket.dev/" /tmp/reach-output.log; then
echo "PASS: Full scan report URL found"
grep "Full scan report URL:" /tmp/reach-output.log
elif grep -q "Diff Url: https://socket.dev/" /tmp/reach-output.log; then
echo "PASS: Diff URL found"
grep "Diff Url:" /tmp/reach-output.log
else
echo "FAIL: No report URL found in scan output"
cat /tmp/reach-output.log
exit 1
fi