summaryrefslogtreecommitdiff
path: root/lib/mlibc/.github/workflows/ci.yml
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-07 17:28:00 -0500
committerIan Moffett <ian@osmora.org>2024-03-07 17:28:32 -0500
commitbd5969fc876a10b18613302db7087ef3c40f18e1 (patch)
tree7c2b8619afe902abf99570df2873fbdf40a4d1a1 /lib/mlibc/.github/workflows/ci.yml
parenta95b38b1b92b172e6cc4e8e56a88a30cc65907b0 (diff)
lib: Add mlibc
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/.github/workflows/ci.yml')
-rw-r--r--lib/mlibc/.github/workflows/ci.yml123
1 files changed, 123 insertions, 0 deletions
diff --git a/lib/mlibc/.github/workflows/ci.yml b/lib/mlibc/.github/workflows/ci.yml
new file mode 100644
index 0000000..d8b0360
--- /dev/null
+++ b/lib/mlibc/.github/workflows/ci.yml
@@ -0,0 +1,123 @@
+name: Continuous Integration
+
+on: [push, pull_request]
+
+jobs:
+ build-mlibc:
+ strategy:
+ matrix:
+ arch: [x86_64, riscv64, aarch64, x86]
+ builds: [mlibc, mlibc-static, mlibc-shared, mlibc-ansi-only, mlibc-headers-only]
+ name: Build mlibc
+ runs-on: ubuntu-22.04
+ container:
+ image: ghcr.io/managarm/mlibc-crossers:latest
+ steps:
+ - name: Install prerequisites
+ run: |
+ apt-get update
+ apt-get install -y ninja-build qemu-user \
+ python3-setuptools python3-jsonschema \
+ python3-pexpect python3-pip netbase
+ pip install --break-system-packages -U xbstrap pyexpect meson
+ - name: Prepare directories
+ run: |
+ mkdir src/
+ mkdir src/mlibc/
+ mkdir build/
+ - name: Checkout
+ uses: actions/checkout@v2
+ with:
+ path: src/mlibc/
+ - name: Prepare src/
+ run: |
+ cp mlibc/ci/bootstrap.yml .
+ touch mlibc/checkedout.xbstrap
+ working-directory: src/
+ - name: Prepare build/
+ run: |
+ cat > bootstrap-site.yml << EOF
+ define_options:
+ arch: ${{matrix.arch}}
+ EOF
+ xbstrap init ../src
+ working-directory: build/
+ - name: Build mlibc
+ run: 'xbstrap install ${{matrix.builds}}'
+ working-directory: build/
+ - name: Test mlibc
+ run: 'meson test -v -C pkg-builds/${{matrix.builds}}'
+ working-directory: build/
+
+ compile-sysdeps:
+ strategy:
+ matrix:
+ sysdeps: [dripos, lemon, aero, ironclad, lyre, keyronex, managarm]
+ name: Compile sysdeps
+ runs-on: ubuntu-22.04
+ container:
+ image: ghcr.io/managarm/mlibc-crossers:latest
+ steps:
+ - name: Install prerequisites
+ run: |
+ apt-get update
+ apt-get install -y ninja-build qemu-user \
+ python3-setuptools python3-jsonschema \
+ python3-pip
+ pip install --break-system-packages -U xbstrap meson
+ - if: ${{ matrix.sysdeps == 'managarm' }}
+ name: Checkout bootstrap-managarm
+ uses: actions/checkout@v2
+ with:
+ repository: 'managarm/bootstrap-managarm'
+ path: src/
+ - name: Checkout
+ uses: actions/checkout@v2
+ with:
+ path: src/mlibc/
+ - if: ${{ matrix.sysdeps == 'managarm' }}
+ name: Set up managarm subprojects directory
+ run: |
+ mkdir -p src/mlibc/subprojects build
+ (
+ cd build
+ xbstrap init ../src
+ xbstrap regenerate libdrm
+ )
+ - if: ${{ matrix.sysdeps == 'managarm' }}
+ name: Clone managarm/managarm
+ uses: actions/checkout@v4
+ with:
+ repository: 'managarm/managarm'
+ path: 'src/mlibc/subprojects/managarm'
+ - if: ${{ matrix.sysdeps == 'managarm' }}
+ name: Clone managarm/bragi
+ uses: actions/checkout@v4
+ with:
+ repository: 'managarm/bragi'
+ path: 'src/mlibc/subprojects/bragi'
+ - if: ${{ matrix.sysdeps == 'managarm' }}
+ name: Install bragi
+ run: |
+ pip install --break-system-packages -U bragi
+ - name: Set up linux kernel headers
+ run: |
+ mkdir -p build/mlibc/
+ cp src/mlibc/ci/bootstrap.yml src/
+ (
+ cd build
+ xbstrap init ../src
+ xbstrap install linux-headers
+ )
+ - name: Compile sysdeps
+ run: |
+ meson setup \
+ "-Dc_args=['-fno-stack-protector', '-U__linux__', '-Wno-error=maybe-uninitialized', '-D__${{matrix.sysdeps}}__']" \
+ "-Dcpp_args=['-fno-stack-protector', '-U__linux__', '-Wno-error=maybe-uninitialized', '-D__${{matrix.sysdeps}}__']" \
+ "-Dbuild_tests=true" \
+ "-Db_sanitize=undefined" \
+ "-Dlinux_kernel_headers=$(pwd)/packages/linux-headers/usr/include" \
+ --cross-file ../src/mlibc/ci/${{matrix.sysdeps}}.cross-file compile-${{matrix.sysdeps}} \
+ "../src/mlibc/"
+ ninja -C compile-${{matrix.sysdeps}}
+ working-directory: build/