mirror of
https://github.com/apple/container.git
synced 2026-10-20 04:50:59 +00:00
Today our CI builds all of the linux code we have with musl and libc to ensure everything is silky smooth. We should have a way to do the same locally. This adds a new macOS only goal that spins up a container (requires `container` to be installed) that builds an image with our deps (libarchive and compression libs) and then builds the project. It supports supplying whatever libc (musl or glibc) to verify they both work.
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
name: Linux build
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, reopened, synchronize]
|
|
push:
|
|
branches:
|
|
- main
|
|
- release/*
|
|
|
|
jobs:
|
|
swift-version:
|
|
name: Determine Swift version
|
|
runs-on: ubuntu-24.04
|
|
outputs:
|
|
image: ${{ steps.version.outputs.image }}
|
|
steps:
|
|
- name: Checkout .swift-version
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
|
|
with:
|
|
sparse-checkout: .swift-version
|
|
sparse-checkout-cone-mode: false
|
|
|
|
- name: Read Swift version
|
|
id: version
|
|
run: echo "image=swift:$(cat .swift-version)-noble" >> "$GITHUB_OUTPUT"
|
|
|
|
build:
|
|
name: Linux compile check
|
|
needs: swift-version
|
|
timeout-minutes: 30
|
|
runs-on: ubuntu-24.04
|
|
container: ${{ needs.swift-version.outputs.image }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install system dependencies
|
|
run: apt-get update && apt-get install -y curl make libarchive-dev libbz2-dev liblzma-dev libssl-dev
|
|
|
|
- name: Build containerization
|
|
run: make containerization
|
|
|
|
- name: Build vminitd (glibc)
|
|
run: make -C vminitd SWIFT_CONFIGURATION="--disable-automatic-resolution -Xswiftc -warnings-as-errors"
|
|
|
|
- name: Install Static Linux SDK
|
|
run: make -C vminitd linux-sdk
|
|
|
|
- name: Build vminitd (musl)
|
|
run: make -C vminitd
|