Repository navigation
81 lines (69 loc) · 2.9 KB
/
Copy pathmend.yml
File metadata and controls
81 lines (69 loc) · 2.9 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
name: "Mend"
on:
push:
branches: ["release-*", "main"]
pull_request:
branches: ["release-*", "main"]
concurrency:
group: mend-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: "22"
PYTHON_VERSION: "3.12"
jobs:
mend-scan:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@v7
- name: Setup Node.js Environment
uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: ./src/frontend/package-lock.json
- name: Install Frontend Dependencies
working-directory: ./src/frontend
run: npm ci
- name: Set up Java (Semeru)
uses: actions/setup-java@v5
with:
distribution: "semeru"
java-version: "21"
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@v10.0.0
with:
version: latest-known
- name: Export Python deps for Mend
run: |
uv export --quiet --locked --all-packages --all-extras --all-groups --no-emit-workspace \
--no-annotate --no-header --no-hashes --format requirements.txt -o requirements-workspace-mend.txt
# The R2 mirror returns 404 for missing packages, avoiding Mend retries on HTTP 403.
uv pip compile --quiet --python-version ${{ env.PYTHON_VERSION }} \
--python-platform x86_64-unknown-linux-gnu --index https://download-r2.pytorch.org/whl/cpu \
--index-strategy unsafe-first-match --emit-index-url --generate-hashes --no-annotate --no-header \
requirements-workspace-mend.txt -o requirements-mend.txt
uv pip compile --quiet --python-version ${{ env.PYTHON_VERSION }} \
--index-strategy unsafe-first-match --generate-hashes --constraint requirements-mend.txt \
scripts/gp/requirements.txt -o requirements-gp-mend.txt
python scripts/ci/prepare_mend_requirements.py --python-version ${{ env.PYTHON_VERSION }}
- name: Download Mend Unified Agent
run: |
curl --fail --show-error --retry 3 --location -o wss-unified-agent.jar https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar
- name: Run Mend Scan
#prevent forks from running mend scans
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
env:
WS_APIKEY: ${{ secrets.WS_APIKEY }}
WS_WSS_URL: ${{ secrets.WS_WSS_URL }}
WS_USERKEY: ${{ secrets.WS_USERKEY }}
WS_PRODUCTNAME: ${{ secrets.WS_PRODUCTNAME }}
WS_PROJECTNAME: ${{ secrets.WS_PROJECTNAME }}
run: |
java -jar wss-unified-agent.jar -d . -c wss-generated.config -logLevel info