Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Compare/rust client lib #715

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 50 additions & 57 deletions .github/workflows/kuksa_databroker-cli_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,51 @@ concurrency:

jobs:
lint:
name: Linting
name: Lint
runs-on: ubuntu-latest

steps:
- name: Installing JVM
run: sudo apt update && sudo apt-get install -y default-jre
- uses: actions/checkout@v3

- name: cargo fmt
working-directory: ${{github.workspace}}
run: cargo fmt -- --check
- name: cargo clippy
working-directory: ${{github.workspace}}
run: cargo clippy --all-targets -- -W warnings -D warnings
check_ghcr_push:
uses: eclipse-kuksa/kuksa-actions/.github/workflows/check_ghcr_push.yml@2
- name: cargo clippy feature kuksa
working-directory: ${{github.workspace}}
run: cargo clippy --all-targets --no-default-features --features feature_kuksa -- -W warnings -D warnings

- name: "Createbom: License check and Dash output generation"
working-directory: ${{github.workspace}}/kuksa_databroker/createbom
run: |
cargo install cargo-license
python3 createbom.py --dash ${{github.workspace}}/dash-databroker-cli-deps ../databroker-cli

- name: Dash license check
uses: ./.github/actions/check-dash
with:
dashinput: ${{github.workspace}}/dash-databroker-cli-deps



checkrights:
uses: ./.github/workflows/check_push_rights.yml
secrets: inherit

# Run on selfhosted, because our runner has native ARM build in a remote
# builder (no need for qemu)
build-container:
runs-on: ubuntu-latest
needs: check_ghcr_push
runs-on: [ self-hosted ]
needs: checkrights

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Building
working-directory: ${{github.workspace}}/kuksa_databroker/
run: |
cargo install cargo-license cross
./build-all-targets-cli.sh

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
Expand All @@ -80,15 +92,16 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# only needed for runners without buildx setup, will be slow
#- name: Set up QEMU
# uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# - name: Set up Docker Buildx
# id: buildx
# uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
if: needs.check_ghcr_push.outputs.push == 'true'
if: needs.checkrights.outputs.have_secrets == 'true'
uses: docker/login-action@v2
with:
registry: ghcr.io
Expand All @@ -97,13 +110,12 @@ jobs:

- name: Build kuksa.val databroker CLI container and push to ghcr.io (and ttl.sh)
id: ghcr-build
if: needs.check_ghcr_push.outputs.push == 'true'
if: ${{ needs.checkrights.outputs.have_secrets == 'true' && github.event_name != 'pull_request' }}
uses: docker/build-push-action@v4
with:
platforms: |
linux/amd64
linux/arm64
linux/riscv64
file: ./kuksa_databroker/Dockerfile-cli
context: .
push: true
Expand All @@ -112,15 +124,14 @@ jobs:
ttl.sh/kuksa.val/kuksa-databroker-cli-${{github.sha}}
labels: ${{ steps.meta.outputs.labels }}

- name: Build ephemeral KUKSA Databroker container and push to ttl.sh
if: needs.check_ghcr_push.outputs.push == 'false'
- name: Build ephemereal kuksa.val databroker container and push to ttl.sh
if: ${{ needs.checkrights.outputs.have_secrets == 'false' || github.event_name == 'pull_request' }}
id: tmp-build
uses: docker/build-push-action@v4
with:
platforms: |
linux/amd64
linux/arm64
linux/riscv64
file: ./kuksa_databroker/Dockerfile-cli
context: .
push: true
Expand All @@ -133,40 +144,22 @@ jobs:
with:
image: ttl.sh/kuksa.val/kuksa-databroker-cli-${{github.sha}}

- name: "Archiving AMD64 artifacts"
uses: actions/upload-artifact@v3
with:
name: databroker-cli-amd64
path: ${{github.workspace}}/dist/amd64

- name: "Archiving ARM64 artifacts"
uses: actions/upload-artifact@v3
- name: Extracting ARM64 binaries
uses: ./.github/actions/copy-from-oci
with:
name: databroker-cli-arm64
path: ${{github.workspace}}/dist/arm64
platform: linux/arm64
id: databroker-cli-arm64
image: ttl.sh/kuksa.val/kuksa-databroker-cli-${{github.sha}}
src: /app/
export: true
transform: s/app/databroker-cli/

- name: "Archiving RISCV64 artifacts"
uses: actions/upload-artifact@v3
- name: Extracting AMD64 binaries
uses: ./.github/actions/copy-from-oci
with:
name: databroker--cli-riscv64
path: ${{github.workspace}}/dist/riscv64


bom:
name: Bill of Material Check
runs-on: ubuntu-latest
needs: build-container

steps:
- uses: actions/checkout@v3

- name: "Createbom: License check and Dash output generation"
working-directory: ${{github.workspace}}/kuksa_databroker/createbom
run: |
cargo install cargo-license
python3 createbom.py --dash ${{github.workspace}}/dash-databroker-deps ../databroker

- name: Dash license check
uses: eclipse-kuksa/kuksa-actions/check-dash@2
with:
dashinput: ${{github.workspace}}/dash-databroker-deps
platform: linux/amd64
id: databroker-cli-amd64
image: ttl.sh/kuksa.val/kuksa-databroker-cli-${{github.sha}}
src: /app/
export: true
transform: s/app/databroker-cli/
38 changes: 38 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ members = [
"kuksa_databroker/databroker-proto",
"kuksa_databroker/databroker-cli",
"kuksa_databroker/databroker-examples",
"kuksa_databroker/lib",
"kuksa_databroker/lib/kuksa",
"kuksa_databroker/lib/sdv",
]

[workspace.dependencies]
Expand Down
Loading