|
| 1 | +name: libinstruments CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "main" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "main" ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +env: |
| 11 | + PICOTLS_COMMIT: 5a4461d8a3948d9d26bf861e7d90cb80d8093515 |
| 12 | + PICOQUIC_COMMIT: 3335f4029b55f59a4868cacf3e92c3fb84982115 |
| 13 | + LWIP_COMMIT: 4599f551dead9eac233b91c0b9ee5879f5d0620a |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + include: |
| 21 | + - os: ubuntu-22.04-large |
| 22 | + name: Linux |
| 23 | + quic: false |
| 24 | + - os: windows-latest-large |
| 25 | + name: Windows |
| 26 | + quic: false |
| 27 | + - os: ubuntu-22.04-large |
| 28 | + name: Linux (QUIC) |
| 29 | + quic: true |
| 30 | + - os: windows-latest-large |
| 31 | + name: Windows (QUIC) |
| 32 | + quic: true |
| 33 | + |
| 34 | + runs-on: ${{ matrix.os }} |
| 35 | + name: Build on ${{ matrix.name }} |
| 36 | + |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + |
| 40 | + # ── Linux: system deps ──────────────────────────────────────────────── |
| 41 | + - name: Install Linux system dependencies |
| 42 | + if: runner.os == 'Linux' |
| 43 | + run: | |
| 44 | + sudo apt-get update -qq |
| 45 | + sudo apt-get install -y \ |
| 46 | + cmake ninja-build pkg-config \ |
| 47 | + autoconf automake libtool \ |
| 48 | + libplist-dev \ |
| 49 | + libusbmuxd-dev \ |
| 50 | + libimobiledevice-dev \ |
| 51 | + libssl-dev |
| 52 | +
|
| 53 | + - name: Build libimobiledevice-glue from source (Linux) |
| 54 | + if: runner.os == 'Linux' |
| 55 | + run: | |
| 56 | + # libimobiledevice-glue is not packaged in Ubuntu 22.04 |
| 57 | + git clone --depth=1 https://github.com/libimobiledevice/libimobiledevice-glue.git /tmp/libimobiledevice-glue |
| 58 | + cd /tmp/libimobiledevice-glue |
| 59 | + ./autogen.sh --prefix=/usr/local |
| 60 | + make -j$(nproc) |
| 61 | + sudo make install |
| 62 | + sudo ldconfig |
| 63 | +
|
| 64 | + # ── Windows: MSYS2 ─────────────────────────────────────────────────── |
| 65 | + - name: Set up MSYS2 (Windows) |
| 66 | + if: runner.os == 'Windows' |
| 67 | + uses: msys2/setup-msys2@v2 |
| 68 | + with: |
| 69 | + msystem: MINGW64 |
| 70 | + update: true |
| 71 | + install: >- |
| 72 | + mingw-w64-x86_64-cmake |
| 73 | + mingw-w64-x86_64-ninja |
| 74 | + mingw-w64-x86_64-pkg-config |
| 75 | + mingw-w64-x86_64-libimobiledevice |
| 76 | + mingw-w64-x86_64-libimobiledevice-glue |
| 77 | + mingw-w64-x86_64-openssl |
| 78 | +
|
| 79 | + # ── QUIC deps: clone at pinned commits ─────────────────────────────── |
| 80 | + - name: Clone QUIC dependencies |
| 81 | + if: matrix.quic |
| 82 | + shell: bash |
| 83 | + run: | |
| 84 | + git clone https://github.com/private-octopus/picotls /tmp/picotls |
| 85 | + git -C /tmp/picotls checkout ${{ env.PICOTLS_COMMIT }} |
| 86 | + git -C /tmp/picotls submodule update --init --recursive |
| 87 | +
|
| 88 | + git clone https://github.com/private-octopus/picoquic /tmp/picoquic |
| 89 | + git -C /tmp/picoquic checkout ${{ env.PICOQUIC_COMMIT }} |
| 90 | +
|
| 91 | + git clone https://github.com/lwip-tcpip/lwip /tmp/lwip |
| 92 | + git -C /tmp/lwip checkout ${{ env.LWIP_COMMIT }} |
| 93 | +
|
| 94 | + # ── Configure ──────────────────────────────────────────────────────── |
| 95 | + - name: Configure (Linux) |
| 96 | + if: runner.os == 'Linux' && !matrix.quic |
| 97 | + run: | |
| 98 | + cmake -B build -S . \ |
| 99 | + -G Ninja \ |
| 100 | + -DCMAKE_BUILD_TYPE=Release \ |
| 101 | + -DINSTRUMENTS_BUILD_TOOL=ON \ |
| 102 | + -DCMAKE_PREFIX_PATH=/usr/local |
| 103 | +
|
| 104 | + - name: Configure (Linux, QUIC) |
| 105 | + if: runner.os == 'Linux' && matrix.quic |
| 106 | + run: | |
| 107 | + cmake -B build -S . \ |
| 108 | + -G Ninja \ |
| 109 | + -DCMAKE_BUILD_TYPE=Release \ |
| 110 | + -DINSTRUMENTS_BUILD_TOOL=ON \ |
| 111 | + -DINSTRUMENTS_HAS_QUIC=ON \ |
| 112 | + -DPICOTLS_SOURCE_DIR=/tmp/picotls \ |
| 113 | + -DPICOQUIC_SOURCE_DIR=/tmp/picoquic \ |
| 114 | + -DLWIP_SOURCE_DIR=/tmp/lwip \ |
| 115 | + -DCMAKE_PREFIX_PATH=/usr/local |
| 116 | +
|
| 117 | + - name: Build (Linux) |
| 118 | + if: runner.os == 'Linux' |
| 119 | + run: cmake --build build --parallel |
| 120 | + |
| 121 | + # ── Windows builds (configure + build in one MSYS2 shell) ──────────── |
| 122 | + - name: Configure & Build (Windows) |
| 123 | + if: runner.os == 'Windows' && !matrix.quic |
| 124 | + shell: msys2 {0} |
| 125 | + run: | |
| 126 | + cmake -B build -S . \ |
| 127 | + -G Ninja \ |
| 128 | + -DCMAKE_BUILD_TYPE=Release \ |
| 129 | + -DINSTRUMENTS_BUILD_TOOL=ON |
| 130 | + cmake --build build --parallel |
| 131 | +
|
| 132 | + - name: Configure & Build (Windows, QUIC) |
| 133 | + if: runner.os == 'Windows' && matrix.quic |
| 134 | + shell: msys2 {0} |
| 135 | + run: | |
| 136 | + cmake -B build -S . \ |
| 137 | + -G Ninja \ |
| 138 | + -DCMAKE_BUILD_TYPE=Release \ |
| 139 | + -DINSTRUMENTS_BUILD_TOOL=ON \ |
| 140 | + -DINSTRUMENTS_HAS_QUIC=ON \ |
| 141 | + -DPICOTLS_SOURCE_DIR=/tmp/picotls \ |
| 142 | + -DPICOQUIC_SOURCE_DIR=/tmp/picoquic \ |
| 143 | + -DLWIP_SOURCE_DIR=/tmp/lwip |
| 144 | + cmake --build build --parallel |
0 commit comments