-
Notifications
You must be signed in to change notification settings - Fork 8
52 lines (49 loc) · 1.54 KB
/
codegraph-impact.yml
File metadata and controls
52 lines (49 loc) · 1.54 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
name: Codegraph Impact Analysis
on: [pull_request]
permissions:
contents: read
concurrency:
group: codegraph-impact-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
impact:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: '22'
- name: Install dependencies
shell: bash
run: |
for attempt in 1 2 3; do
npm install && break
if [ "$attempt" -lt 3 ]; then
echo "::warning::npm install attempt $attempt failed, retrying in 15s..."
sleep 15
else
echo "::error::npm install failed after 3 attempts"
exit 1
fi
done
- uses: actions/cache@v5
with:
path: .codegraph/
key: codegraph-${{ hashFiles('src/**', 'package.json') }}
restore-keys: codegraph-
- name: Build graph
run: node dist/cli.js build || (rm -rf .codegraph && node dist/cli.js build --no-incremental)
- name: Run impact analysis
run: node dist/cli.js diff-impact origin/${{ github.base_ref }} --json -T > impact.json
- name: Save PR number
run: echo "${{ github.event.pull_request.number }}" > pr-number.txt
- name: Upload impact artifact
uses: actions/upload-artifact@v4
with:
name: codegraph-impact
path: |
impact.json
pr-number.txt
retention-days: 1