|
| 1 | +name: Build-debian |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +env: |
| 9 | + SDK_VERSION_STANDALONE: 1.4.309.0 |
| 10 | + SDK_VERSION_REPO: 1.4.309 |
| 11 | + |
| 12 | +jobs: |
| 13 | + Linux: |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + os: |
| 18 | + - name: debian |
| 19 | + version: bookworm |
| 20 | + container: debian:bookworm |
| 21 | + sdk_type: [repo, standalone] |
| 22 | + docs: [true, false] |
| 23 | + exclude: |
| 24 | + - sdk_type: standalone |
| 25 | + docs: true |
| 26 | + |
| 27 | + runs-on: ubuntu-latest |
| 28 | + container: |
| 29 | + image: ${{ matrix.os.container }} |
| 30 | + env: |
| 31 | + SDK_VERSION_STANDALONE: 1.4.309.0 |
| 32 | + SDK_VERSION_REPO: 1.4.309 |
| 33 | + |
| 34 | + defaults: |
| 35 | + run: |
| 36 | + shell: bash |
| 37 | + |
| 38 | + steps: |
| 39 | + - name: show env |
| 40 | + run: env |
| 41 | + - name: Install General Dependencies |
| 42 | + run: | |
| 43 | + apt-get update |
| 44 | + apt-get upgrade |
| 45 | + apt-get install -y \ |
| 46 | + git \ |
| 47 | + ccache \ |
| 48 | + build-essential \ |
| 49 | + cmake \ |
| 50 | + pkgconf \ |
| 51 | + libgtkmm-3.0-dev \ |
| 52 | + libcairomm-1.0-dev \ |
| 53 | + libsigc++-2.0-dev \ |
| 54 | + libyaml-cpp-dev \ |
| 55 | + catch2 \ |
| 56 | + libglfw3-dev \ |
| 57 | + curl \ |
| 58 | + xzip \ |
| 59 | + libhidapi-dev \ |
| 60 | + ninja-build \ |
| 61 | + glslang-dev \ |
| 62 | + glslang-tools \ |
| 63 | + spirv-tools \ |
| 64 | + glslc |
| 65 | +
|
| 66 | + - name: Install Docs Dependencies |
| 67 | + if: ${{ matrix.docs }} |
| 68 | + run: | |
| 69 | + apt-get install -y \ |
| 70 | + texlive \ |
| 71 | + texlive-fonts-extra \ |
| 72 | + texlive-extra-utils |
| 73 | +
|
| 74 | + - name: Install Vulkan Repo Dependencies |
| 75 | + if: ${{ (matrix.sdk_type == 'repo') }} |
| 76 | + run: | |
| 77 | + apt-get install -y \ |
| 78 | + libvulkan-dev |
| 79 | +
|
| 80 | + - name: Check Out Code |
| 81 | + uses: actions/checkout@v4 |
| 82 | + with: |
| 83 | + submodules: recursive |
| 84 | + fetch-depth: 0 |
| 85 | + |
| 86 | + - name: Use CCache |
| 87 | + if: ${{ ! matrix.docs }} |
| 88 | + uses: hendrikmuhs/ccache-action@v1.2 |
| 89 | + with: |
| 90 | + key: ${{ github.job }}-${{ matrix.os.container }}-${{ matrix.sdk_type}} |
| 91 | + max-size: "1500M" |
| 92 | + |
| 93 | + - name: Cache Vulkan SDK Standalone |
| 94 | + if: ${{ matrix.sdk_type == 'standalone' }} |
| 95 | + uses: actions/cache@v4 |
| 96 | + with: |
| 97 | + path: ~/VulkanSDK |
| 98 | + key: ${{ matrix.os.container }}-vulkansdk-${{ env.SDK_VERSION_STANDALONE }} |
| 99 | + |
| 100 | + - name: Install Vulkan SDK (Standalone) |
| 101 | + if: ${{ matrix.sdk_type == 'standalone' }} |
| 102 | + run: | |
| 103 | + [[ -d ~/VulkanSDK/${{ env.SDK_VERSION_STANDALONE }} ]] && exit 0 |
| 104 | + cd |
| 105 | + mkdir VulkanSDK |
| 106 | + cd VulkanSDK |
| 107 | + curl -LO https://sdk.lunarg.com/sdk/download/${{ env.SDK_VERSION_STANDALONE }}/linux/vulkansdk-linux-x86_64-${{ env.SDK_VERSION_STANDALONE }}.tar.xz |
| 108 | + tar xf vulkansdk-linux-x86_64-${{ env.SDK_VERSION_STANDALONE }}.tar.xz |
| 109 | +
|
| 110 | + - name: Cache FFTS |
| 111 | + uses: actions/cache@v4 |
| 112 | + with: |
| 113 | + path: ~/ffts |
| 114 | + key: ${{ runner.os }}-${{ matrix.os.container }}-ffts |
| 115 | + |
| 116 | + - name: Clone and Build FFTS Library |
| 117 | + run: | |
| 118 | + [[ ${{ matrix.docs }} = 'false' ]] && export CMAKE_C_COMPILER_LAUNCHER=ccache && export CMAKE_CXX_COMPILER_LAUNCHER=ccache |
| 119 | + if [[ ! -d ~/ffts ]]; then |
| 120 | + cd |
| 121 | + git clone https://github.com/anthonix/ffts.git |
| 122 | + cd ffts |
| 123 | + mkdir build |
| 124 | + cd build |
| 125 | + cmake \ |
| 126 | + -DENABLE_SHARED=ON \ |
| 127 | + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ |
| 128 | + -GNinja \ |
| 129 | + .. |
| 130 | + ninja |
| 131 | + fi |
| 132 | + cd ~/ffts/build |
| 133 | + ninja install |
| 134 | +
|
| 135 | + - name: Configure |
| 136 | + run: | |
| 137 | + [[ (${{matrix.sdk_type }} = 'standalone') ]] && source $HOME/VulkanSDK/${{ env.SDK_VERSION_STANDALONE }}/setup-env.sh |
| 138 | + [[ ${{ matrix.docs }} = 'false' ]] && export CMAKE_C_COMPILER_LAUNCHER=ccache && export CMAKE_CXX_COMPILER_LAUNCHER=ccache |
| 139 | +
|
| 140 | + mkdir build |
| 141 | + cd build |
| 142 | + cmake \ |
| 143 | + -DCMAKE_BUILD_TYPE=Release \ |
| 144 | + -DDISABLE_PCH=ON \ |
| 145 | + -GNinja \ |
| 146 | + -DCPACK_GENERATOR=DEB \ |
| 147 | + -DCMAKE_INSTALL_PREFIX=/usr \ |
| 148 | + .. |
| 149 | +
|
| 150 | + - name: Build |
| 151 | + if: ${{ ! matrix.docs }} |
| 152 | + run: | |
| 153 | + cd build |
| 154 | + ninja |
| 155 | +
|
| 156 | + - name: Build Package |
| 157 | + if: ${{ ! matrix.docs }} |
| 158 | + run: | |
| 159 | + cd build |
| 160 | + ninja package |
| 161 | +
|
| 162 | + - name: Build Docs |
| 163 | + if: ${{ matrix.docs }} |
| 164 | + run: | |
| 165 | + cd build |
| 166 | + ninja doc |
| 167 | +
|
| 168 | + - name: Run Tests |
| 169 | + if: ${{ ! matrix.docs }} |
| 170 | + run: | |
| 171 | + export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json |
| 172 | + cd build |
| 173 | + ctest --output-on-failure |
| 174 | +
|
| 175 | + - name: Upload Artifacts |
| 176 | + if: ${{ ! matrix.docs }} |
| 177 | + uses: actions/upload-artifact@v4 |
| 178 | + with: |
| 179 | + name: ngscopeclient-${{ matrix.os.name }}-${{ matrix.os.version }}-${{ github.job }}-${{ matrix.sdk_type }} |
| 180 | + path: | |
| 181 | + build/src/ngscopeclient/ngscopeclient |
| 182 | + build/src/ngscopeclient/icons/* |
| 183 | + build/src/ngscopeclient/shaders/* |
| 184 | + build/lib/scopehal/libscopehal.so |
| 185 | + build/lib/scopeprotocols/libscopeprotocols.so |
| 186 | + build/Testing/Temporary/LastTest.log |
| 187 | +
|
| 188 | + - name: Upload Package |
| 189 | + if: ${{ ! matrix.docs }} |
| 190 | + uses: actions/upload-artifact@v4 |
| 191 | + with: |
| 192 | + name: ngscopeclient-${{ matrix.os.name }}-${{ matrix.os.version }}-${{ github.job }}-${{ matrix.sdk_type }}-package |
| 193 | + path: build/*.deb |
| 194 | + |
| 195 | + - name: Upload Documentation |
| 196 | + if: ${{ matrix.docs }} |
| 197 | + uses: actions/upload-artifact@v4 |
| 198 | + with: |
| 199 | + name: ngscopeclient-${{ matrix.os.name }}-${{ matrix.os.version }}-${{ github.job }}-docs |
| 200 | + path: build/doc/ngscopeclient-manual.pdf |
0 commit comments