Skip to content

Commit 0e2592d

Browse files
committed
Fix build scripts etc..
- Fix build scripts - Update parts of doc - Add cache
1 parent 032eca7 commit 0e2592d

File tree

12 files changed

+232
-174
lines changed

12 files changed

+232
-174
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
**/target/
1+

.github/workflows/check_license.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
name: spdx
1+
name: Check SPDX headers
22

33
on:
4-
pull_request
4+
pull_request:
5+
workflow_call:
6+
57

68
concurrency:
79
group: ${{ github.ref }}-${{ github.workflow }}
810
cancel-in-progress: true
911

1012
jobs:
1113
check-spdx-headers:
14+
name: Check SPDX headers
15+
1216
runs-on: ubuntu-latest
1317

1418
steps:
15-
1619
- name: Checkout code
1720
uses: actions/checkout@v4
1821
with:

.github/workflows/kuksa_databroker-cli_build.yml

Lines changed: 47 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# * SPDX-License-Identifier: Apache-2.0
1212
# ********************************************************************************/
1313

14-
name: kuksa_databroker-cli_build
14+
name: Build kuksa-databroker-cli
1515

1616
on:
1717
push:
@@ -32,37 +32,59 @@ concurrency:
3232

3333
jobs:
3434
lint:
35-
name: Linting
35+
name: Lint
3636
runs-on: ubuntu-latest
3737

3838
steps:
3939
- uses: actions/checkout@v4
40-
40+
- uses: actions/cache@v4
41+
with:
42+
path: |
43+
~/.cargo/bin/
44+
~/.cargo/registry/index/
45+
~/.cargo/registry/cache/
46+
~/.cargo/git/db/
47+
target/
48+
key: databroker-cli-lint-${{ hashFiles('**/Cargo.lock') }}
4149
- name: cargo fmt
4250
working-directory: ${{github.workspace}}
4351
run: cargo fmt -- --check
4452
- name: cargo clippy
4553
working-directory: ${{github.workspace}}
4654
run: cargo clippy --all-targets -- -W warnings -D warnings
55+
4756
check_ghcr_push:
57+
name: Check access rights
4858
uses: eclipse-kuksa/kuksa-actions/.github/workflows/check_ghcr_push.yml@2
4959
secrets: inherit
5060

51-
# Run on selfhosted, because our runner has native ARM build in a remote
52-
# builder (no need for qemu)
5361
build-container:
62+
name: Build multiarch container
5463
runs-on: ubuntu-latest
5564
needs: check_ghcr_push
5665

5766
steps:
5867
- uses: actions/checkout@v4
5968
with:
6069
submodules: recursive
61-
70+
- uses: actions/cache@v4
71+
with:
72+
path: |
73+
~/.cargo/bin/
74+
~/.cargo/registry/index/
75+
~/.cargo/registry/cache/
76+
~/.cargo/git/db/
77+
target/
78+
key: databroker-cli-release-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
79+
80+
- name: Install build prerequisites
81+
working-directory: ${{github.workspace}}/
82+
run: |
83+
which cargo-license || cargo install cargo-license
84+
which cross || cargo install cross
6285
- name: Building
6386
working-directory: ${{github.workspace}}/
6487
run: |
65-
cargo install cargo-license cross
6688
./build-all-targets-cli.sh
6789
6890
- name: Docker meta
@@ -71,7 +93,7 @@ jobs:
7193
with:
7294
# list of Docker images to use as base name for tags
7395
images: |
74-
ghcr.io/eclipse-kuksa/kuksa-databrokerdatabroker-cli
96+
ghcr.io/eclipse-kuksa/kuksa-databroker-cli
7597
# generate Docker tags based on the following events/attributes
7698
tags: |
7799
type=ref,event=branch
@@ -80,9 +102,6 @@ jobs:
80102
type=semver,pattern={{major}}.{{minor}}
81103
type=semver,pattern={{major}}
82104
83-
- name: Set up QEMU
84-
uses: docker/setup-qemu-action@v3
85-
86105
- name: Set up Docker Buildx
87106
id: buildx
88107
uses: docker/setup-buildx-action@v3
@@ -95,7 +114,7 @@ jobs:
95114
username: ${{ github.repository_owner }}
96115
password: ${{ secrets.GITHUB_TOKEN }}
97116

98-
- name: Build kuksa.val databroker CLI container and push to ghcr.io (and ttl.sh)
117+
- name: Build kuksa-databroker-cli container and push to ghcr.io (and ttl.sh)
99118
id: ghcr-build
100119
if: needs.check_ghcr_push.outputs.push == 'true'
101120
uses: docker/build-push-action@v5
@@ -109,13 +128,13 @@ jobs:
109128
push: true
110129
tags: |
111130
${{ steps.meta.outputs.tags }}
112-
ttl.sh/kuksa.val/kuksa-databroker-cli-${{github.sha}}
131+
ttl.sh/eclipse-kuksa/kuksa-databroker-cli-${{github.sha}}
113132
labels: ${{ steps.meta.outputs.labels }}
114133
# Provenance to solve that an unknown/unkown image is shown on ghcr.io
115134
# Same problem as described in https://github.com/orgs/community/discussions/45969
116135
provenance: false
117136

118-
- name: Build ephemeral KUKSA Databroker container and push to ttl.sh
137+
- name: Build ephemeral kuksa-databroker-cli container and push to ttl.sh
119138
if: needs.check_ghcr_push.outputs.push == 'false'
120139
id: tmp-build
121140
uses: docker/build-push-action@v5
@@ -127,7 +146,7 @@ jobs:
127146
file: ./Dockerfile-cli
128147
context: .
129148
push: true
130-
tags: "ttl.sh/kuksa.val/kuksa-databroker-cli-${{github.sha}}"
149+
tags: "ttl.sh/eclipse-kuksa/kuksa-databroker-cli-${{github.sha}}"
131150
labels: ${{ steps.meta.outputs.labels }}
132151
# Provenance to solve that an unknown/unkown image is shown on ghcr.io
133152
# Same problem as described in https://github.com/orgs/community/discussions/45969
@@ -137,7 +156,7 @@ jobs:
137156
- name: Posting message
138157
uses: ./.github/actions/post-container-location
139158
with:
140-
image: ttl.sh/kuksa.val/kuksa-databroker-cli-${{github.sha}}
159+
image: ttl.sh/eclipse-kuksa/kuksa-databroker-cli-${{github.sha}}
141160

142161
- name: "Archiving AMD64 artifacts"
143162
uses: actions/upload-artifact@v4
@@ -154,22 +173,30 @@ jobs:
154173
- name: "Archiving RISCV64 artifacts"
155174
uses: actions/upload-artifact@v4
156175
with:
157-
name: databroker--cli-riscv64
176+
name: databroker-cli-riscv64
158177
path: ${{github.workspace}}/dist/riscv64
159178

160179

161180
bom:
162-
name: Bill of Material Check
181+
name: Check Bill of Material
163182
runs-on: ubuntu-latest
164-
needs: build-container
165183

166184
steps:
167185
- uses: actions/checkout@v4
186+
- uses: actions/cache@v4
187+
with:
188+
path: |
189+
~/.cargo/bin/
190+
~/.cargo/registry/index/
191+
~/.cargo/registry/cache/
192+
~/.cargo/git/db/
193+
target/
194+
key: databroker-cli-bom-${{ hashFiles('**/Cargo.lock') }}
168195

169196
- name: "Createbom: License check and Dash output generation"
170197
working-directory: ${{github.workspace}}/createbom
171198
run: |
172-
cargo install cargo-license
199+
which cargo-license || cargo install cargo-license
173200
python3 createbom.py --dash ${{github.workspace}}/dash-databroker-deps ../databroker
174201
175202
- name: Dash license check

0 commit comments

Comments
 (0)