-
Notifications
You must be signed in to change notification settings - Fork 90
83 lines (71 loc) · 2.18 KB
/
diff.yml
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
---
name: Diff report
permissions: read-all
on:
workflow_call:
inputs:
report_name:
description: 'name of artifact to store the diff'
required: true
type: string
left:
description: 'name of artifact for left side of compare'
required: true
type: string
right:
description: 'name of artifact for right side of compare'
required: true
type: string
jobs:
report:
runs-on: [self-hosted, linux]
steps:
- name: Cleanup workspace
run: sudo rm -rf ..?* .[!.]* *
- name: Download left artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.left }}
path: left
- name: Extract package
run: unzip left/*.zip -d ${{ inputs.left }}
- name: Download right artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.right }}
path: right
- name: Extract package
run: unzip right/*.zip -d ${{ inputs.right }}
- name: Checkout PR branch
uses: actions/checkout@v4
with:
path: source
- name: Run Diff
run: |
mkdir report
python3 source/.github/workflows/diff/bom_diff.py \
"${{ inputs.left }}" \
"${{ inputs.right }}" \
--mode All \
--title "Bom Report (Full)" \
--output report/FULL_BOM.html
python3 source/.github/workflows/diff/bom_diff.py \
"${{ inputs.left }}" \
"${{ inputs.right }}" \
--mode Diff \
--title "Bom Report (Diff)" \
--output report/DIFF_BOM.html
python3 source/.github/workflows/diff/bom_diff.py \
"${{ inputs.left }}" \
"${{ inputs.right }}" \
--mode Orphan \
--title "Bom Report (Orphan)" \
--output report/ORPHAN_BOM.html
- name: Upload artifact
uses: actions/upload-artifact@v4
if: (success() || failure()) && inputs.report_name
with:
name: ${{ inputs.report_name }}
path: ./report/
- name: Cleanup workspace
run: sudo rm -rf ..?* .[!.]* *