Skip to content

Commit 69a205b

Browse files
committed
CI and SBOM updated
1 parent 8599c8f commit 69a205b

4 files changed

Lines changed: 199 additions & 97 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 137 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
name: Build and Test
1+
name: Build
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: [ "master", "ci" ]
6+
tags:
7+
- "v*"
68
pull_request:
79
branches: [ "master" ]
8-
# Workflow can be triggered manually
9-
workflow_dispatch:
1010

1111
jobs:
1212

1313
build:
14-
1514
runs-on: windows-2025
16-
15+
timeout-minutes: 10
16+
1717
steps:
18-
- uses: actions/checkout@v6
18+
- uses: actions/checkout@v7
1919

2020
- name: Setup MSBuild
2121
uses: microsoft/setup-msbuild@v3
@@ -28,24 +28,139 @@ jobs:
2828

2929
- name: Build
3030
run: MSBuild.exe -p:Configuration="Release"
31-
32-
# TODO: There are no tests yet
33-
#- name: Build Tests
34-
# run: MSBuild.exe -p:Configuration="Release" -t:"ModuleControl OpenLoop Tests"
35-
31+
3632
- name: Export binaries
3733
uses: actions/upload-artifact@v6
3834
with:
39-
name: binaries
35+
name: PositionInterfaceClient.zip
4036
path: ${{ github.workspace }}/bin/Release
37+
38+
# For some reason sbomify with cdxgen fails to generate the initial SBOM (although it works with other repos)
39+
# Instead we generate it here like this
40+
- name: Generate initial SBOM
41+
uses: CycloneDX/gh-dotnet-generate-sbom@master
42+
with:
43+
path: ./PositionInterfaceClient.sln
44+
json: true
45+
github-bearer-token: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Export initial SBOM
48+
uses: actions/upload-artifact@v6
49+
with:
50+
name: sbom_temp1.cdx.json
51+
path: bom.json
52+
53+
54+
sbom_pt1:
55+
runs-on: ubuntu-latest
56+
timeout-minutes: 10
57+
needs: build
58+
59+
steps:
60+
- uses: actions/checkout@v7
61+
62+
# Liest die Core-Version aus dem NSIS-Installer-Skript
63+
- name: Get software version
64+
run: |
65+
VER_MAJOR=`grep -E -o "SWVersionMajor[[:blank:]]+=[[:blank:]][[:digit:]]+" MainWindow.xaml.cs | sed "s/[^0-9.]*//g"`
66+
VER_MINOR=`grep -E -o "SWVersionMinor[[:blank:]]+=[[:blank:]][[:digit:]]+" MainWindow.xaml.cs | sed "s/[^0-9.]*//g"`
67+
VER_PATCH=`grep -E -o "SWVersionPatch[[:blank:]]+=[[:blank:]][[:digit:]]+" MainWindow.xaml.cs | sed "s/[^0-9.]*//g"`
68+
echo "Software version '$VER_MAJOR.$VER_MINOR.$VER_PATCH' detected"
69+
echo "SW_VERSION=$VER_MAJOR.$VER_MINOR.$VER_PATCH" >> $GITHUB_ENV
70+
71+
- name: Import temporary SBOM
72+
uses: actions/download-artifact@v8
73+
with:
74+
name: sbom_temp1.cdx.json
75+
76+
# SBOM erstellen
77+
# Wie man die packages.lock.json bekommt: https://devblogs.microsoft.com/dotnet/enable-repeatable-package-restores-using-a-lock-file/
78+
- uses: sbomify/sbomify-action@master
79+
env:
80+
SBOM_FILE: bom.json
81+
#LOCK_FILE: packages.lock.json
82+
OUTPUT_FILE: sbom_temp2.cdx.json
83+
COMPONENT_NAME: PositionInterfaceClient
84+
COMPONENT_VERSION: ${{ env.SW_VERSION }}
85+
# Produkt- und Firmeninfo werden aus sbomify.json geladen
86+
AUGMENT: true
87+
# Metadaten aus Paket-Registry hinzufügen
88+
ENRICH: true
89+
# Metadaten aus additional_packages.txt hinzufügen
90+
#ADDITIONAL_PACKAGES_FILE: ${{ github.workspace }}/additional_packages.txt
91+
UPLOAD: false
92+
93+
- name: Export incomplete SBOM
94+
uses: actions/upload-artifact@v7
95+
with:
96+
name: sbom_temp2.cdx.json
97+
path: sbom_temp2.cdx.json
98+
archive: false
99+
100+
101+
sbom_pt2:
102+
runs-on: windows-2025
103+
timeout-minutes: 10
104+
needs: sbom_pt1
41105

42-
#- name: Run Tests
43-
# run: |
44-
# & "C:\Program Files\Microsoft Visual Studio\18\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe" "$($env:GITHUB_WORKSPACE)\CRI_Client\CRI_Client_Tests.dll"
106+
steps:
107+
- uses: actions/checkout@v7
108+
109+
- name: Import temporary SBOM
110+
uses: actions/download-artifact@v8
111+
with:
112+
name: sbom_temp2.cdx.json
113+
114+
- name: Import binaries
115+
uses: actions/download-artifact@v8
116+
with:
117+
name: PositionInterfaceClient.zip
118+
skip-decompress: true
119+
120+
- name: Final SBOM enrichment
121+
uses: CommonplaceRobotics/Action_SBOM_Enrichment@v9
122+
with:
123+
database: .github/workflows/sbom_enrichment_db.json
124+
sbom: sbom_temp2.cdx.json
125+
sbom_out: sbom.cdx.json
126+
msproj_file: PositionInterfaceClient.csproj
127+
128+
- name: Export SBOM
129+
uses: actions/upload-artifact@v7
130+
with:
131+
path: sbom.cdx.json
132+
archive: false
45133

46-
#- name: Run tests
47-
# uses: microsoft/vstest-action@main
48-
# with:
49-
# testAssembly: CRI_Client_Tests.dll
50-
# searchFolder: ${{ github.workspace }}\Tests\bin\Release\net481\
51-
# runInParallel: true
134+
- name: Validate SBOM with company policies
135+
uses: CommonplaceRobotics/Action_Validate_SBOM@v6
136+
with:
137+
sbom: sbom.cdx.json
138+
139+
140+
release:
141+
name: Publish GitHub Release
142+
needs: sbom_pt2
143+
runs-on: ubuntu-latest
144+
if: startsWith(github.ref, 'refs/tags/')
145+
permissions:
146+
contents: write
147+
148+
steps:
149+
- name: Import binaries
150+
uses: actions/download-artifact@v8
151+
with:
152+
name: PositionInterfaceClient.zip
153+
path: dist/
154+
skip-decompress: true
155+
156+
- name: Import SBOM
157+
uses: actions/download-artifact@v8
158+
with:
159+
name: sbom.cdx.json
160+
path: dist/
161+
162+
- name: Create GitHub Release
163+
uses: softprops/action-gh-release@v2
164+
with:
165+
files: dist/*
166+
generate_release_notes: true

‎.github/workflows/sbom.yml‎

Lines changed: 0 additions & 74 deletions
This file was deleted.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"components":
3+
[
4+
{
5+
"purl": "pkg:generic/positioninterfaceclient@",
6+
"type": "application",
7+
"creator": "support@cpr-robots.com",
8+
"filename": "PositionInterfaceClient.zip",
9+
"original_licenses": [ "MIT" ],
10+
"distribution_licenses": [ "MIT" ],
11+
"effective_license": "MIT",
12+
"executable": true,
13+
"archive": true,
14+
"structured": true
15+
},
16+
{
17+
"purl": "pkg:nuget/Microsoft.CSharp",
18+
"creator": "https://learn.microsoft.com/en-us/dotnet/csharp/",
19+
"version": "4.0.30319",
20+
"original_licenses":
21+
[
22+
"MIT"
23+
],
24+
"distribution_licenses":
25+
[
26+
"MIT"
27+
],
28+
"effective_license": "MIT",
29+
"executable": true
30+
},
31+
{
32+
"purl": "pkg:nuget/System*",
33+
"creator": "https://learn.microsoft.com/en-us/dotnet/",
34+
"version": "4.8",
35+
"original_licenses":
36+
[
37+
"Microsoft .NET Framework Redistributable EULA"
38+
],
39+
"distribution_licenses":
40+
[
41+
"Microsoft .NET Framework Redistributable EULA"
42+
],
43+
"effective_license": "Microsoft .NET Framework Redistributable EULA",
44+
"executable": true
45+
},
46+
{
47+
"purl": "pkg:nuget/Microsoft.NETCore.Platforms",
48+
"original_licenses":
49+
[
50+
"MIT"
51+
],
52+
"distribution_licenses":
53+
[
54+
"MIT"
55+
],
56+
"effective_license": "MIT",
57+
"executable": true
58+
}
59+
],
60+
"remove-components":
61+
[]
62+
}

‎README.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Position Interface Demo Client
22
[![Build and Test](https://github.com/CommonplaceRobotics/SW_PositionInterfaceClient/actions/workflows/build.yml/badge.svg)](https://github.com/CommonplaceRobotics/SW_PositionInterfaceClient/actions/workflows/build.yml)
3-
[![SBOM and Security Audit](https://github.com/CommonplaceRobotics/SW_PositionInterfaceClient/actions/workflows/sbom.yml/badge.svg)](https://github.com/CommonplaceRobotics/SW_PositionInterfaceClient/actions/workflows/sbom.yml)
43

54
This is the demonstration and test client for the fast position interface of robots based on the igus Robot Control (iRC) or Commonplace Robotics' RobotControl Core. This interface is supported in V14-003 and newer.
65

0 commit comments

Comments
 (0)