diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..8c52596c6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,144 @@ +name: Build +on: + push: + paths-ignore: + - '**.md' + - 'LICENSE' + - '.gitignore' + - 'resources/**' + pull_request: + paths-ignore: + - '**.md' + - 'LICENSE' + - '.gitignore' + - 'resources/**' + workflow_dispatch: +jobs: + python: + name: Python - ${{ matrix.platform[0] }} - ${{ matrix.platform[2] }} + runs-on: ${{ matrix.platform[1] }} + strategy: + fail-fast: false + matrix: + platform: + - [Linux, ubuntu-latest, x86_64] + - [Linux, ubuntu-latest, i686] + - [Linux, ubuntu-latest, aarch64] + - [Windows, windows-latest, AMD64] + - [Windows, windows-latest, x86] + - [Windows, windows-latest, ARM64] + - [MacOS, macos-latest, x86_64] + - [MacOS, macos-latest, arm64] + # spdlog fails to build with the correct architecture on universal2 + # - [MacOS, macos-latest, universal2] + # ppc64le is too obscure and slow to build due to emulation + # - [Linux, ubuntu-latest, ppc64le] + # s390x is too obscure is not compatible due to being big-endian + # - [Linux, ubuntu-latest, s390x] + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v3 + with: + platforms: all + + - uses: actions/setup-python@v4 + with: + python-version: '3.12' + + - name: Install cibuildwheel + run: python -m pip install --upgrade cibuildwheel + + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_ARCHS: ${{ matrix.platform[2] }} + CIBW_BUILD: cp38* cp312* + CIBW_SKIP: "*-musllinux*" + + - name: Inspect + run: ls wheelhouse/ + + conan: + name: Conan - ${{ matrix.platform[0] }} - ${{ matrix.platform[2] }} + runs-on: ${{ matrix.platform[1] }} + strategy: + fail-fast: false + matrix: + platform: + - [Linux, ubuntu-latest, gcc] + - [Linux, ubuntu-latest, clang] + - [Windows, windows-latest, msvc] + - [MacOS, macos-latest, apple-clang] + steps: + - uses: actions/checkout@v3 + + - name: Install Clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "17.0" + + - name: Set env for Clang + if: matrix.platform[2] == 'clang' + run: echo "CC=clang" >> $GITHUB_ENV && echo "CXX=clang++" >> $GITHUB_ENV + + - name: Install Conan + id: conan + uses: turtlebrowser/get-conan@main + + - name: Create default profile + run: conan profile detect + + - name: Build Conan package - static + run: conan create . --build missing + + - name: Build Conan package - shared + run: conan create . --build missing -o "*/*:shared=True" + + standalone: + name: CMake - ${{ matrix.platform[0] }} - ${{ matrix.platform[2] }} + runs-on: ${{ matrix.platform[1] }} + strategy: + fail-fast: false + matrix: + platform: + - [Linux, ubuntu-latest, gcc] + - [Linux, ubuntu-latest, clang] + - [Windows, windows-latest, msvc] + - [MacOS, macos-latest, apple-clang] + steps: + - uses: actions/checkout@v3 + + - name: Install Clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "17.0" + + - name: Set env for Clang + if: matrix.platform[2] == 'clang' + run: echo "CC=clang" >> $GITHUB_ENV && echo "CXX=clang++" >> $GITHUB_ENV + + - uses: lukka/get-cmake@latest + with: + cmakeVersion: "~3.27" + + - name: Install Conan + id: conan + uses: turtlebrowser/get-conan@main + + - name: Configure + run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release + + - name: Build + run: cmake --build build --parallel + + - name: Test + run: ctest --test-dir build + + - name: Install + run: cmake --install build --prefix install + + - name: Inspect + run: tree install/ diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml deleted file mode 100644 index 0f1b230bf..000000000 --- a/.github/workflows/python.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Build Python -on: - push: - paths-ignore: - - '**.md' - - 'LICENSE' - - '.gitignore' - - 'resources/**' - pull_request: - paths-ignore: - - '**.md' - - 'LICENSE' - - '.gitignore' - - 'resources/**' - workflow_dispatch: -jobs: - build_wheels: - name: ${{ matrix.platform[0] }} - ${{ matrix.platform[2] }} - runs-on: ${{ matrix.platform[1] }} - strategy: - fail-fast: false - matrix: - platform: - - [Linux, ubuntu-latest, x86_64] - - [Linux, ubuntu-latest, i686] - - [Linux, ubuntu-latest, aarch64] - - [Windows, windows-latest, AMD64] - - [Windows, windows-latest, x86] - - [Windows, windows-latest, ARM64] - - [MacOS, macos-latest, x86_64] - - [MacOS, macos-latest, arm64] - # spdlog fails to build with the correct architecture on universal2 - # - [MacOS, macos-latest, universal2] - # ppc64le is too obscure and slow to build due to emulation - # - [Linux, ubuntu-latest, ppc64le] - # s390x is too obscure is not compatible due to being big-endian - # - [Linux, ubuntu-latest, s390x] - steps: - - uses: actions/checkout@v4 - - - name: Set up QEMU - if: runner.os == 'Linux' - uses: docker/setup-qemu-action@v3 - with: - platforms: all - - - uses: actions/setup-python@v4 - with: - python-version: '3.12' - - - name: Install cibuildwheel - run: python -m pip install --upgrade cibuildwheel - - - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse - env: - CIBW_ARCHS: ${{ matrix.platform[2] }} - CIBW_BUILD: cp38* cp312* - CIBW_SKIP: "*-musllinux*" - - - name: Inspect - run: ls wheelhouse/