Skip to content

Commit 12de309

Browse files
committed
ci: new build pipeline
1 parent 1aea31d commit 12de309

File tree

17 files changed

+216
-178
lines changed

17 files changed

+216
-178
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"runArgs": [
55
"--privileged",
66
"--cap-add=NET_ADMIN",
7-
"--cap-add=NET_RAW"
7+
"--cap-add=NET_RAW",
8+
"--network=host"
89
],
910
"features": {
1011
"ghcr.io/devcontainers/features/common-utils:2": {
@@ -38,5 +39,5 @@
3839
"mounts": [
3940
"source=${env:HOME},target=/mnt/hosthome,type=bind,consistency=cached,readonly"
4041
],
41-
"postStartCommand": "if [ -f /mnt/hosthome/.p10k.zsh ]; then cp /mnt/hosthome/.p10k.zsh /home/vscode/.p10k.zsh; fi && git clone --depth=1 https://github.com/romkatv/powerlevel10k.git /home/vscode/.oh-my-zsh/custom/themes/powerlevel10k && sed -i 's|^ZSH_THEME=.*|ZSH_THEME=\\\"powerlevel10k/powerlevel10k\\\"|' /home/vscode/.zshrc && echo '\nif [[ -r \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\" ]]; then\n source \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\"\nfi\n\n[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh' >> /home/vscode/.zshrc"
42+
"postStartCommand": "if [ -f /mnt/hosthome/.p10k.zsh ]; then cp /mnt/hosthome/.p10k.zsh /home/vscode/.p10k.zsh; fi && git clone --depth=1 https://github.com/romkatv/powerlevel10k.git /home/vscode/.oh-my-zsh/custom/themes/powerlevel10k && sed -i 's|^ZSH_THEME=.*|ZSH_THEME=\\\"powerlevel10k/powerlevel10k\\\"|' /home/vscode/.zshrc && echo '\nif [[ -r \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\" ]]; then\n source \"${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh\"\nfi\n\n[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh' >> /home/vscode/.zshrc && docker buildx create --name liqo-builder --use --driver-opt network=host"
4243
}

.github/workflows/check-generated-artifacts.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
- name: Setup Go
2121
uses: actions/setup-go@v5
2222
with:
23-
go-version: '1.24'
23+
go-version-file: go.mod
24+
cache: true
25+
cache-dependency-path: go.sum
2426

2527
- name: Run the automatic generation
2628
working-directory: ./

.github/workflows/codeql.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ jobs:
7474

7575
- uses: actions/setup-go@v5
7676
with:
77-
go-version: '1.24'
77+
go-version-file: go.mod
78+
cache: true
79+
cache-dependency-path: go.sum
7880

7981
# Initializes the CodeQL tools for scanning.
8082
- name: Initialize CodeQL

.github/workflows/integration.yml

Lines changed: 65 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- master
88
- release
99
- ipam
10+
- frc/buildpipeline
1011
repository_dispatch:
1112
types:
1213
- test-command
@@ -46,7 +47,7 @@ jobs:
4647
echo "commit-ref=${{ github.sha }}" >> $GITHUB_OUTPUT
4748
else
4849
echo "master=false" >> $GITHUB_OUTPUT
49-
echo "architectures=linux/amd64" >> $GITHUB_OUTPUT
50+
echo "architectures=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
5051
echo "commit-ref=${{ github.sha }}" >> $GITHUB_OUTPUT
5152
fi
5253
@@ -74,27 +75,14 @@ jobs:
7475
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }}
7576
if: ${{ github.event_name == 'repository_dispatch' }}
7677

77-
build:
78+
build-old:
7879
runs-on: ubuntu-latest
7980
needs: configure
8081
strategy:
8182
fail-fast: false
8283
matrix:
8384
component:
8485
- cert-creator
85-
- crd-replicator
86-
- ipam
87-
- liqo-controller-manager
88-
- webhook
89-
- uninstaller
90-
- virtual-kubelet
91-
- metric-agent
92-
- telemetry
93-
- proxy
94-
- gateway
95-
- gateway/wireguard
96-
- gateway/geneve
97-
- fabric
9886
steps:
9987
- name: Set architectures
10088
id: set-architectures
@@ -164,10 +152,64 @@ jobs:
164152
rm -rf /tmp/.buildx-cache
165153
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
166154
155+
build:
156+
runs-on: ubuntu-latest
157+
needs: configure
158+
env:
159+
DOCKER_REGISTRY: ghcr.io
160+
DOCKER_ORGANIZATION: ${{ github.repository_owner }}
161+
DOCKER_TAG: ${{ needs.configure.outputs.commit-ref }}
162+
DOCKER_PUSH: true
163+
ARCHS: ${{ needs.configure.outputs.architectures }}
164+
strategy:
165+
fail-fast: false
166+
matrix:
167+
component:
168+
- crd-replicator
169+
- ipam
170+
- liqo-controller-manager
171+
- webhook
172+
- uninstaller
173+
- virtual-kubelet
174+
- metric-agent
175+
- telemetry
176+
- proxy
177+
- gateway
178+
- gateway/wireguard
179+
- gateway/geneve
180+
- fabric
181+
steps:
182+
- name: Check out code
183+
uses: actions/checkout@v4
184+
with:
185+
ref: "${{ needs.configure.outputs.commit-ref }}"
186+
repository: "${{ needs.configure.outputs.repo-name }}"
187+
persist-credentials: false
167188

189+
- name: Setup Go
190+
uses: actions/setup-go@v5
191+
with:
192+
go-version-file: go.mod
193+
cache: true
194+
cache-dependency-path: go.sum
195+
196+
- name: Set up Docker Buildx
197+
uses: docker/setup-buildx-action@v3
198+
199+
- name: Login to the Container registry
200+
uses: docker/login-action@v3
201+
with:
202+
registry: ghcr.io
203+
username: ${{ github.actor }}
204+
password: ${{ secrets.GITHUB_TOKEN }}
205+
206+
- name: Build and push the container image
207+
run: |
208+
chmod +x ./build/liqo/build.sh
209+
./build/liqo/build.sh ./cmd/${{ matrix.component }}
168210
post-build:
169211
runs-on: ubuntu-latest
170-
needs: [build, configure, liqoctl]
212+
needs: [build-old, build, configure, liqoctl]
171213
steps:
172214

173215
# Since we are using a repository-dispatch event, we have to explicitly set a run check. We update it to the actual status.
@@ -228,12 +270,18 @@ jobs:
228270
ref: "${{ needs.configure.outputs.commit-ref }}"
229271
repository: "${{ needs.configure.outputs.repo-name }}"
230272
persist-credentials: false
273+
274+
- name: Setup Go
275+
uses: actions/setup-go@v5
276+
with:
277+
go-version-file: go.mod
278+
cache: true
279+
cache-dependency-path: go.sum
231280

232281
- name: Build Liqoctl
233282
run: |
234283
./build/liqoctl/build.sh
235284
env:
236-
CGO_ENABLED: 0
237285
GOOS: ${{ matrix.goos }}
238286
GOARCH: ${{ matrix.goarch }}
239287
LIQOCTLVERSION: ${{ needs.configure.outputs.commit-ref }}

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup Go
1818
uses: actions/setup-go@v5
1919
with:
20-
go-version: '1.24'
20+
go-version-file: go.mod
2121
cache: false
2222

2323
- name: golangci-lint
@@ -42,7 +42,7 @@ jobs:
4242
- name: Setup Go
4343
uses: actions/setup-go@v5
4444
with:
45-
go-version: '1.24'
45+
go-version-file: go.mod
4646

4747
- name: Execute go mod tidy and check the outcome
4848
working-directory: ./

build/cert-creator/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM alpine:3.21.3
22

33
RUN apk update && \
4-
apk add --no-cache openssl && \
5-
rm -rf /var/cache/apk/*
4+
apk add --no-cache openssl && \
5+
rm -rf /var/cache/apk/*
66

77
ENTRYPOINT ["openssl"]

build/common/Dockerfile

Lines changed: 0 additions & 26 deletions
This file was deleted.

build/fabric/Dockerfile

Lines changed: 0 additions & 20 deletions
This file was deleted.

build/gateway/Dockerfile

Lines changed: 0 additions & 20 deletions
This file was deleted.

build/gateway/geneve/Dockerfile

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)