From fa2247cc20a9f123e9ac49f3f24982dfa66e2898 Mon Sep 17 00:00:00 2001 From: Paul Koch Date: Wed, 24 Jul 2024 14:31:26 -0700 Subject: [PATCH] compile in actions --- .github/workflows/ci.yml | 92 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23daa9ed3..0a9fbda98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,3 +26,95 @@ env: ubuntu_test: ubuntu-latest mac_test: macOS-latest windows_test: windows-latest + +jobs: + bld: + strategy: + matrix: + include: + - name: linux_release_64 + image: ${{ env.ubuntu_bld }} + asm: "-asm" + options: "-release_64" + artifact_name: "libebm_ubuntu_release_64" + - name: linux_debug_64 + image: ${{ env.ubuntu_bld }} + asm: "" + options: "-debug_64" + artifact_name: "libebm_ubuntu_debug_64" + - name: mac_release_64 + image: ${{ env.mac_bld }} + asm: "-asm" + options: "-release_64" + artifact_name: "libebm_mac_release_64" + - name: mac_debug_64 + image: ${{ env.mac_bld }} + asm: "" + options: "-debug_64" + artifact_name: "libebm_mac_debug_64" + - name: mac_release_arm + image: macOS-13-arm64 + asm: "-asm" + options: "-release_arm" + artifact_name: "libebm_mac_release_arm" + - name: mac_debug_arm + image: macOS-13-arm64 + asm: "" + options: "-debug_arm" + artifact_name: "libebm_mac_debug_arm" + - name: win_release_64 + image: ${{ env.windows_bld }} + asm: "" + options: "-release_64" + artifact_name: "libebm_win_release_64" + - name: win_debug_64 + image: ${{ env.windows_bld }} + asm: "" + options: "-debug_64" + artifact_name: "libebm_win_debug_64" + runs-on: ${{ matrix.image }} + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Download CUDA installer + if: startsWith(matrix.image, 'windows') + run: | + curl -O https://developer.download.nvidia.com/compute/cuda/11.2.2/network_installers/cuda_11.2.2_win10_network.exe + + - name: Build on Windows + if: startsWith(matrix.image, 'windows') + run: | + SET PATH=%PATH%;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\ + SET CudaToolkitDir=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2 + cuda_11.2.2_win10_network.exe -s nvcc_11.2 visual_studio_integration_11.2 cudart_11.2 + IF ERRORLEVEL 1 ( + ECHO cuda_11.2.2_win10_network.exe FAILED + EXIT /B 201 + ) + .\build.bat ${{ matrix.options }} ${{ matrix.asm }} + + - name: Build on Linux + if: startsWith(matrix.image, 'ubuntu') + run: | + sudo apt --yes update + sudo apt --yes install nvidia-cuda-toolkit + /bin/sh ./build.sh ${{ matrix.options }} ${{ matrix.asm }} + + - name: Build on macOS + if: startsWith(matrix.image, 'macOS') + run: | + /bin/sh ./build.sh ${{ matrix.options }} ${{ matrix.asm }} + + - name: Publish native shared library + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }} + path: bld/lib + + - name: Publish assembly x64 + if: ${{ matrix.asm != '' }} + uses: actions/upload-artifact@v2 + with: + name: asm-${{ matrix.artifact_name }} + path: bld/asm/