|
46 | 46 | cat /tmp/scan-output.log |
47 | 47 | exit 1 |
48 | 48 | fi |
| 49 | +
|
| 50 | + e2e-reachability: |
| 51 | + runs-on: ubuntu-latest |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 |
| 54 | + with: |
| 55 | + fetch-depth: 0 |
| 56 | + |
| 57 | + - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 |
| 58 | + with: |
| 59 | + python-version: '3.12' |
| 60 | + |
| 61 | + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af |
| 62 | + with: |
| 63 | + node-version: '20' |
| 64 | + |
| 65 | + - name: Install CLI from local repo |
| 66 | + run: | |
| 67 | + python -m pip install --upgrade pip |
| 68 | + pip install . |
| 69 | +
|
| 70 | + - name: Install uv |
| 71 | + run: pip install uv |
| 72 | + |
| 73 | + - name: Run Socket CLI with reachability |
| 74 | + env: |
| 75 | + SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_CLI_API_TOKEN }} |
| 76 | + run: | |
| 77 | + set -o pipefail |
| 78 | + socketcli \ |
| 79 | + --target-path tests/e2e/fixtures/simple-npm \ |
| 80 | + --reach \ |
| 81 | + --disable-blocking \ |
| 82 | + --enable-debug \ |
| 83 | + 2>&1 | tee /tmp/reach-output.log |
| 84 | +
|
| 85 | + - name: Verify reachability analysis completed |
| 86 | + run: | |
| 87 | + if grep -q "Reachability analysis completed successfully" /tmp/reach-output.log; then |
| 88 | + echo "PASS: Reachability analysis completed" |
| 89 | + grep "Reachability analysis completed successfully" /tmp/reach-output.log |
| 90 | + grep "Results written to:" /tmp/reach-output.log || true |
| 91 | + else |
| 92 | + echo "FAIL: Reachability analysis did not complete successfully" |
| 93 | + cat /tmp/reach-output.log |
| 94 | + exit 1 |
| 95 | + fi |
| 96 | +
|
| 97 | + - name: Verify scan produced a report |
| 98 | + run: | |
| 99 | + if grep -q "Full scan report URL: https://socket.dev/" /tmp/reach-output.log; then |
| 100 | + echo "PASS: Full scan report URL found" |
| 101 | + grep "Full scan report URL:" /tmp/reach-output.log |
| 102 | + elif grep -q "Diff Url: https://socket.dev/" /tmp/reach-output.log; then |
| 103 | + echo "PASS: Diff URL found" |
| 104 | + grep "Diff Url:" /tmp/reach-output.log |
| 105 | + else |
| 106 | + echo "FAIL: No report URL found in scan output" |
| 107 | + cat /tmp/reach-output.log |
| 108 | + exit 1 |
| 109 | + fi |
0 commit comments