build.yml (17583B)
1 name: "Build" 2 on: 3 push: 4 pull_request: 5 6 concurrency: 7 group: "${{github.workflow}}-${{github.ref}}" 8 cancel-in-progress: ${{github.ref != 'refs/heads/master'}} 9 10 defaults: 11 run: 12 shell: bash 13 14 jobs: 15 build: 16 strategy: 17 fail-fast: false 18 matrix: 19 include: 20 - { title: "linux/analyze-build", host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Debug" , defs: "BLEND2D_TEST=0" , diagnostics: "analyze-build" } 21 - { title: "linux/asan" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1" , diagnostics: "asan" } 22 - { title: "linux/msan/no-jit" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1,BLEND2D_NO_JIT=1" , diagnostics: "msan" } 23 - { title: "linux/tsan" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1" , diagnostics: "tsan" } 24 - { title: "linux/tsan/no-futex", host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1,BLEND2D_NO_FUTEX=1", diagnostics: "tsan" } 25 - { title: "linux/ubsan" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1" , diagnostics: "ubsan" } 26 - { title: "linux/hardened" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1" , diagnostics: "hardened" } 27 - { title: "linux/valgrind" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1" , diagnostics: "valgrind" } 28 - { title: "linux/no-jit" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1,BLEND2D_NO_JIT=1" } 29 - { title: "linux/no-tls" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1,BLEND2D_NO_TLS=1" } 30 - { title: "linux/no-futex" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1,BLEND2D_NO_FUTEX=1" } 31 - { title: "linux/use-c++20" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Debug" , defs: "BLEND2D_TEST=1,CMAKE_CXX_FLAGS=-std=c++20" } 32 - { title: "linux/use-c++23" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Debug" , defs: "BLEND2D_TEST=1,CMAKE_CXX_FLAGS=-std=c++23" } 33 - { title: "linux/use-sse4.2" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1,CMAKE_CXX_FLAGS=-msse4.2" } 34 - { title: "linux/use-avx" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1,CMAKE_CXX_FLAGS=-mavx" } 35 - { title: "linux/use-avx2" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1,CMAKE_CXX_FLAGS=-mavx2" } 36 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "gcc-9" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 37 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "gcc-9" , conf: "Release", defs: "BLEND2D_TEST=1" } 38 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "gcc-9" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 39 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "gcc-9" , conf: "Release", defs: "BLEND2D_TEST=1" } 40 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "gcc-10" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 41 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "gcc-10" , conf: "Release", defs: "BLEND2D_TEST=1" } 42 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "gcc-10" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 43 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "gcc-10" , conf: "Release", defs: "BLEND2D_TEST=1" } 44 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "gcc-11" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 45 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "gcc-11" , conf: "Release", defs: "BLEND2D_TEST=1" } 46 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "gcc-11" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 47 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "gcc-11" , conf: "Release", defs: "BLEND2D_TEST=1" } 48 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "gcc-12" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 49 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "gcc-12" , conf: "Release", defs: "BLEND2D_TEST=1" } 50 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "gcc-12" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 51 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "gcc-12" , conf: "Release", defs: "BLEND2D_TEST=1" } 52 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "gcc-13" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 53 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "gcc-13" , conf: "Release", defs: "BLEND2D_TEST=1" } 54 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "gcc-13" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 55 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "gcc-13" , conf: "Release", defs: "BLEND2D_TEST=1" } 56 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "gcc-14" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 57 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "gcc-14" , conf: "Release", defs: "BLEND2D_TEST=1" } 58 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "gcc-14" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 59 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "gcc-14" , conf: "Release", defs: "BLEND2D_TEST=1" } 60 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "clang-14", conf: "Debug" , defs: "BLEND2D_TEST=1" } 61 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "clang-14", conf: "Release", defs: "BLEND2D_TEST=1" } 62 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-14", conf: "Debug" , defs: "BLEND2D_TEST=1" } 63 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-14", conf: "Release", defs: "BLEND2D_TEST=1" } 64 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "clang-15", conf: "Debug" , defs: "BLEND2D_TEST=1" } 65 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "clang-15", conf: "Release", defs: "BLEND2D_TEST=1" } 66 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-15", conf: "Debug" , defs: "BLEND2D_TEST=1" } 67 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-15", conf: "Release", defs: "BLEND2D_TEST=1" } 68 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "clang-16", conf: "Debug" , defs: "BLEND2D_TEST=1" } 69 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "clang-16", conf: "Release", defs: "BLEND2D_TEST=1" } 70 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-16", conf: "Debug" , defs: "BLEND2D_TEST=1" } 71 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-16", conf: "Release", defs: "BLEND2D_TEST=1" } 72 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "clang-17", conf: "Debug" , defs: "BLEND2D_TEST=1" } 73 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "clang-17", conf: "Release", defs: "BLEND2D_TEST=1" } 74 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-17", conf: "Debug" , defs: "BLEND2D_TEST=1" } 75 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-17", conf: "Release", defs: "BLEND2D_TEST=1" } 76 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "clang-18", conf: "Debug" , defs: "BLEND2D_TEST=1" } 77 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "clang-18", conf: "Release", defs: "BLEND2D_TEST=1" } 78 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-18", conf: "Debug" , defs: "BLEND2D_TEST=1" } 79 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-18", conf: "Release", defs: "BLEND2D_TEST=1" } 80 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "clang-19", conf: "Debug" , defs: "BLEND2D_TEST=1" } 81 - { title: "linux" , host: "ubuntu-24.04" , arch: "x86" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1" } 82 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Debug" , defs: "BLEND2D_TEST=1" } 83 - { title: "linux" , host: "ubuntu-24.04" , arch: "x64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1" } 84 - { title: "linux" , host: "ubuntu-24.04-arm", arch: "arm64" , cc: "clang-19", conf: "Debug" , defs: "BLEND2D_TEST=1" } 85 - { title: "linux" , host: "ubuntu-24.04-arm", arch: "arm64" , cc: "clang-19", conf: "Release", defs: "BLEND2D_TEST=1" } 86 - { title: "macos" , host: "macos-13" , arch: "x64" , cc: "gcc-14" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 87 - { title: "macos" , host: "macos-13" , arch: "x64" , cc: "gcc-14" , conf: "Release", defs: "BLEND2D_TEST=1" } 88 - { title: "macos" , host: "macos-13" , arch: "x64" , cc: "clang" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 89 - { title: "macos" , host: "macos-13" , arch: "x64" , cc: "clang" , conf: "Release", defs: "BLEND2D_TEST=1" } 90 - { title: "macos" , host: "macos-14" , arch: "arm64" , cc: "clang" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 91 - { title: "macos" , host: "macos-14" , arch: "arm64" , cc: "clang" , conf: "Release", defs: "BLEND2D_TEST=1" } 92 - { title: "windows" , host: "windows-2022" , arch: "x86" , cc: "vs2022" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 93 - { title: "windows" , host: "windows-2022" , arch: "x86" , cc: "vs2022" , conf: "Release", defs: "BLEND2D_TEST=1" } 94 - { title: "windows" , host: "windows-2022" , arch: "x64" , cc: "vs2022" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 95 - { title: "windows" , host: "windows-2022" , arch: "x64" , cc: "vs2022" , conf: "Release", defs: "BLEND2D_TEST=1" } 96 - { title: "windows" , host: "windows-11-arm" , arch: "arm64" , cc: "vs2022" , conf: "Debug" , defs: "BLEND2D_TEST=1" } 97 - { title: "windows" , host: "windows-11-arm" , arch: "arm64" , cc: "vs2022" , conf: "Release", defs: "BLEND2D_TEST=1" } 98 99 # Cross compiled, cannot run tests (Windows/UWP). 100 - { title: "windows/uwp" , host: "windows-2022" , arch: "x64" , cc: "vs2022" , conf: "Release", defs: "BLEND2D_TEST=0,CMAKE_SYSTEM_NAME=WindowsStore,CMAKE_SYSTEM_VERSION=10.0" } 101 102 - { title: "freebsd" , host: "ubuntu-latest" , arch: "x64" , cc: "clang" , conf: "Release", vm: "freebsd", vm_ver: "14.2", defs: "BLEND2D_TEST=1" } 103 - { title: "freebsd" , host: "ubuntu-latest" , arch: "arm64" , cc: "clang" , conf: "Release", vm: "freebsd", vm_ver: "14.2", defs: "BLEND2D_TEST=1" } 104 - { title: "netbsd" , host: "ubuntu-latest" , arch: "x64" , cc: "clang" , conf: "Release", vm: "netbsd" , vm_ver: "10.1", defs: "BLEND2D_TEST=1" } 105 - { title: "netbsd" , host: "ubuntu-latest" , arch: "arm64" , cc: "clang" , conf: "Release", vm: "netbsd" , vm_ver: "10.1", defs: "BLEND2D_TEST=1" } 106 - { title: "openbsd" , host: "ubuntu-latest" , arch: "x64" , cc: "clang" , conf: "Release", vm: "openbsd", vm_ver: "7.4" , defs: "BLEND2D_TEST=1" } 107 - { title: "openbsd" , host: "ubuntu-latest" , arch: "arm64" , cc: "clang" , conf: "Release", vm: "openbsd", vm_ver: "7.4" , defs: "BLEND2D_TEST=1" } 108 - { title: "debian" , host: "ubuntu-latest" , arch: "arm/v7" , cc: "clang" , conf: "Release", vm: "debian:unstable", defs: "BLEND2D_TEST=1" } 109 - { title: "debian" , host: "ubuntu-latest" , arch: "riscv64", cc: "clang" , conf: "Release", vm: "debian:unstable", defs: "BLEND2D_TEST=1" } 110 - { title: "debian" , host: "ubuntu-latest" , arch: "ppc64le", cc: "clang" , conf: "Release", vm: "debian:unstable", defs: "BLEND2D_TEST=1" } 111 112 name: "${{matrix.title}}/${{matrix.arch}}, ${{matrix.cc}} ${{matrix.conf}}" 113 runs-on: "${{matrix.host}}" 114 115 steps: 116 - name: "Checkout Blend2D" 117 uses: actions/checkout@v4 118 with: 119 path: "source" 120 121 - name: "Checkout AsmJit" 122 uses: actions/checkout@v4 123 with: 124 repository: asmjit/asmjit 125 path: "source/3rdparty/asmjit" 126 127 - name: "Checkout Build Actions" 128 uses: actions/checkout@v4 129 with: 130 repository: build-actions/build-actions 131 path: "build-actions" 132 133 - name: "Python" 134 uses: actions/setup-python@v5 135 with: 136 python-version: "3.x" 137 138 - name: QEMU 139 if: ${{matrix.vm && !matrix.vm_ver}} 140 uses: docker/setup-qemu-action@v3 141 with: 142 platforms: linux/${{matrix.arch}} 143 144 - name: "Build & Test - Native" 145 if: ${{!matrix.vm}} 146 run: python build-actions/action.py 147 --source-dir=source 148 --config=source/.github/workflows/build-config.json 149 --compiler=${{matrix.cc}} 150 --diagnostics=${{matrix.diagnostics}} 151 --architecture=${{matrix.arch}} 152 --problem-matcher=auto 153 --build-type=${{matrix.conf}} 154 --build-defs=${{matrix.defs}} 155 156 - name: "Build & Test - Cross Platform Actions" 157 if: ${{matrix.vm && matrix.vm_ver}} 158 uses: cross-platform-actions/action@master 159 with: 160 operating_system: ${{matrix.vm}} 161 architecture: ${{matrix.arch}} 162 version: ${{matrix.vm_ver}} 163 sync_files: "runner-to-vm" 164 shutdown_vm: false 165 shell: bash 166 run: | 167 set -e 168 169 PATH="/usr/sbin:/usr/pkg/sbin:/usr/pkg/bin:$PATH:$(pwd)/build-actions" 170 CI_NETBSD_USE_PKGIN=1 171 172 export PATH 173 export CI_NETBSD_USE_PKGIN 174 175 sh ./build-actions/prepare-environment.sh 176 python3 build-actions/action.py \ 177 --source-dir=source \ 178 --config=source/.github/workflows/build-config.json \ 179 --compiler=${{matrix.cc}} \ 180 --diagnostics=${{matrix.diagnostics}} \ 181 --architecture=${{matrix.arch}} \ 182 --problem-matcher=auto \ 183 --build-type=${{matrix.conf}} \ 184 --build-defs=${{matrix.defs}} 185 186 - name: "Build & Test - Docker + QEMU" 187 if: ${{matrix.vm && !matrix.vm_ver}} 188 run: | 189 docker run \ 190 --rm \ 191 -v $(pwd):/${{github.workspace}} \ 192 -w ${{github.workspace}}/build-actions \ 193 --platform linux/${{matrix.arch}} \ 194 ${{matrix.vm}} \ 195 bash action.sh \ 196 --source-dir=../source \ 197 --config=../source/.github/workflows/build-config.json \ 198 --compiler=${{matrix.cc}} \ 199 --diagnostics=${{matrix.diagnostics}} \ 200 --architecture=${{matrix.arch}} \ 201 --problem-matcher=auto \ 202 --build-type=${{matrix.conf}} \ 203 --build-defs=${{matrix.defs}}