This repository was archived by the owner on Sep 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
136 lines (133 loc) · 5.17 KB
/
build.yaml
File metadata and controls
136 lines (133 loc) · 5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: build
on:
pull_request:
branches:
- "*"
push:
branches:
- "main"
tags:
- "*"
workflow_dispatch: {}
jobs:
rust-build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rust-src, clippy, rustfmt
override: false
- name: Install bpf-linker
run: |
cargo install bpf-linker
- name: Build all rust crates (dataplane, test server)
run: |
make build
- name: Check formatting
run: |
make check.format
- name: Check clippy
run: |
make lint
- name: Run Tests
run: |
make test
image-builds-integration-tests:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.1.7
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
sources:
- Cargo.lock
- Cargo.toml
- 'controlplane/**'
- 'dataplane/**'
- 'build/Containerfile.*'
- name: Build controlplane Container Image
if: steps.filter.outputs.sources
run: |
mkdir -p target/ &&
podman build \
--userns=host \
--file build/Containerfile.controlplane \
--volume "$(pwd):/workspace" \
--volume "$(pwd)/target:$(pwd)/target/" \
--build-arg BUILD_TIMESTAMP="$(date +%s%3N)" \
--build-arg UID="0" \
--build-arg GID="0" \
--build-arg WORK_DIR="$(pwd)" \
--tag localhost/blixt-controlplane:pr-${{ github.event.pull_request.number }}-${{ github.sha }}
podman push localhost/blixt-controlplane:pr-${{ github.event.pull_request.number }}-${{ github.sha }} \
docker-daemon:localhost/blixt-controlplane:pr-${{ github.event.pull_request.number }}-${{ github.sha }}
- name: Build dataplane Container Image
run: |
podman build \
--userns=host \
--file build/Containerfile.dataplane \
--volume "$(pwd):/workspace" \
--volume "$(pwd)/target:$(pwd)/target/" \
--build-arg BUILD_TIMESTAMP="$(date +%s%3N)" \
--build-arg UID="0" \
--build-arg GID="0" \
--build-arg WORK_DIR="$(pwd)" \
--tag localhost/blixt-dataplane:pr-${{ github.event.pull_request.number }}-${{ github.sha }}
podman push localhost/blixt-dataplane:pr-${{ github.event.pull_request.number }}-${{ github.sha }} \
docker-daemon:localhost/blixt-dataplane:pr-${{ github.event.pull_request.number }}-${{ github.sha }}
- name: Build dataplane Container Image (without build cache from controlplane)
run: |
cargo clean
podman build \
--userns=host \
--file build/Containerfile.dataplane \
--volume "$(pwd):/workspace" \
--volume "$(pwd)/target:$(pwd)/target/" \
--build-arg BUILD_TIMESTAMP="$(date +%s%3N)" \
--build-arg UID="0" \
--build-arg GID="0" \
--build-arg WORK_DIR="$(pwd)" \
--no-cache \
--tag localhost/blixt-dataplane:pr-${{ github.event.pull_request.number }}-${{ github.sha }}
- name: Build udp-test-server Container Image
run: |
podman build \
--userns=host \
--file build/Containerfile.udp-test-server \
--volume "$(pwd):/workspace" \
--volume "$(pwd)/target:$(pwd)/target/" \
--build-arg BUILD_TIMESTAMP="$(date +%s%3N)" \
--build-arg UID="0" \
--build-arg GID="0" \
--build-arg WORK_DIR="$(pwd)" \
--tag localhost/blixt-udp-test-server:pr-${{ github.event.pull_request.number }}-${{ github.sha }}
podman push localhost/blixt-udp-test-server:pr-${{ github.event.pull_request.number }}-${{ github.sha }} \
docker-daemon:localhost/blixt-udp-test-server:pr-${{ github.event.pull_request.number }}-${{ github.sha }}
- name: Install kind and kubectl
uses: helm/kind-action@b72c923563e6e80ea66e8e8c810798cc73e97e5e # current main, includes cloud-provider-kind support
if: steps.filter.outputs.sources
with:
install_only: true
cloud_provider: false
kubectl_version: 'v1.33.3'
- name: Install Rust
if: steps.filter.outputs.sources
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # v1
with:
toolchain: stable
- name: Run Integration Tests
if: steps.filter.outputs.sources
run: |
# kind load broken for podman https://github.com/kubernetes-sigs/kind/issues/3945
export REGISTRY="localhost"
export TAG="pr-${{ github.event.pull_request.number }}-${{ github.sha }}"
sudo chown -R "$(id -u):$(id -g)" target/
make test.integration.reuse