Skip to content

Commit

Permalink
Adapt databroker workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schildt <[email protected]>
  • Loading branch information
SebastianSchildt committed May 5, 2024
1 parent 9b2f87a commit f55e16c
Showing 1 changed file with 34 additions and 47 deletions.
81 changes: 34 additions & 47 deletions .github/workflows/kuksa_databroker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
needs: [bom]
env:
CARGO_TERM_COLOR: always
strategy:
Expand All @@ -105,14 +104,7 @@ jobs:
target: riscv64gc-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- name: Retrieve artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: Third*
merge-multiple: true
- name: Display structure of downloaded files
run: ls -R

- uses: actions/cache@v4
with:
path: |
Expand All @@ -125,27 +117,27 @@ jobs:
- name: Install build prerequisites
working-directory: ${{github.workspace}}/
run: |
which cross || cargo install cross
cargo install cargo-license cross cargo-cyclonedx
- name: Build
working-directory: ${{github.workspace}}/
env:
KUKSA_DATABROKER_FEATURES: databroker/viss,databroker/tls
KUKSA_DATABROKER_SBOM: y
run: |
cross build --target ${{ matrix.platform.target }} --features viss --bin databroker --release
mkdir -p "dist"
cp "target/${{ matrix.platform.target }}/release/databroker" "dist"
- name: Package dist files
shell: bash
working-directory: ${{github.workspace}}
./build-databroker.sh ${{ matrix.platform.target }} --features viss --bin databroker --release
- name: "Archiving artifats"
shell: bash
working-directory: ${{github.workspace}}/dist/{{ matrix.platform.name }}
run: |
cd dist
tar xf ../artifacts/thirdparty.tar.gz
tar -czf databroker-${{ matrix.platform.name }}.tar.gz *
tar -czf ../databroker-${{ matrix.platform.name }}.tar.gz *
- name: Upload artifacts
uses: actions/upload-artifact@v4
- name: "Uploading artifacts"
uses: actions/upload-artifact@v3
with:
name: databroker-${{ matrix.platform.name }}.tar.gz
path: dist/databroker-${{ matrix.platform.name }}.tar.gz
if-no-files-found: error
name: databroker-${{ matrix.platform.target }}
path: ${{github.workspace}}/dist/databroker-${{ matrix.platform.target}}.tar.gz
if-no-files-found: error

check_ghcr_push:
name: Check access rights
Expand Down Expand Up @@ -287,8 +279,9 @@ jobs:
${{github.workspace}}/integration_test/run.sh
bom:
name: Check Bill of Material
name: License Compliance Check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
Expand All @@ -301,28 +294,22 @@ jobs:
target/
key: databroker-bom-${{ hashFiles('**/Cargo.lock') }}

- name: Install prerequisites
working-directory: ${{github.workspace}}/createbom
# Follows the pattern from
# https://github.com/eclipse/dash-licenses?tab=readme-ov-file#example-rustcargo
- name: "Using cargo to create Dash input"
working-directory: ${{github.workspace}}/
# target all is not really needed, and will also return i.e. wasm deps, however
# better safe than sorry, the alternative would be running this for each currently
# built target and combining the lists, but that would need adapting, when
# adding targets, or also when i.e. switching between MUSL/glibc. So this is safer
run: |
which cargo-license || cargo install cargo-license
- name: License check and Dash output generation
working-directory: ${{github.workspace}}/createbom
run: |
python3 createbom.py --dash ${{github.workspace}}/dash-databroker ../databroker
cargo tree -e normal --prefix none --no-dedupe -p databroker --target all --all-features > ${{github.workspace}}/cargodeps
cat ${{github.workspace}}/cargodeps | sort -u \
| grep -v '^[[:space:]]*$' | grep -v kuksa | grep -v databroker \
| sed -E 's|([^ ]+) v([^ ]+).*|crate/cratesio/-/\1/\2|' \
> ${{github.workspace}}/dash-databroker-deps
- name: Dash license check
uses: eclipse-kuksa/kuksa-actions/check-dash@3
uses: eclipse-kuksa/kuksa-actions/check-dash@2
with:
dashinput: ${{github.workspace}}/dash-databroker
- name: Generate Bill of Materials
working-directory: ${{github.workspace}}/createbom
run: |
rm -r ../databroker/thirdparty
python3 createbom.py ../databroker
cd ../databroker
tar czf thirdparty.tar.gz thirdparty
- name: Upload Bill of Materials
uses: actions/upload-artifact@v4
with:
name: Third party licenses
path: databroker/thirdparty.tar.gz
if-no-files-found: error
dashinput: ${{github.workspace}}/dash-databroker-deps

0 comments on commit f55e16c

Please sign in to comment.