This repository was archived by the owner on Sep 8, 2025. It is now read-only.
feat(build): enhance container build times #583
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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:/builder/target/" \ | |
| --build-arg BUILD_TIMESTAMP="$(date +%s%3N)" \ | |
| --build-arg UID="0" \ | |
| --build-arg GID="0" \ | |
| --tag 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:/builder/target/" \ | |
| --build-arg BUILD_TIMESTAMP="$(date +%s%3N)" \ | |
| --build-arg UID="0" \ | |
| --build-arg GID="0" \ | |
| --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:/builder/target/" \ | |
| --build-arg BUILD_TIMESTAMP="$(date +%s%3N)" \ | |
| --build-arg UID="0" \ | |
| --build-arg GID="0" \ | |
| --tag 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: | | |
| export KIND_EXPERIMENTAL_PROVIDER=podman | |
| export REGISTRY="localhost" | |
| export TAG="pr-${{ github.event.pull_request.number }}-${{ github.sha }}" | |
| make test.integration |