From c3a31ebb9803996cb4450fadc80e6316bc3faa05 Mon Sep 17 00:00:00 2001 From: Harold Brenes Date: Fri, 12 May 2023 18:46:18 -0500 Subject: [PATCH] Windows CUDA CI --- .github/workflows/build-release.yml | 143 ++++++++++++++++++++-------- 1 file changed, 104 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 718e781a..20c19942 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -268,50 +268,115 @@ jobs: # path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME }} # if-no-files-found: error - # build-windows-x86-64: - # runs-on: windows-2019 - # steps: - # - name: Checkout Repo - # uses: actions/checkout@v3 + build-bladebit-windows-x86-64: + runs-on: windows-2019 + steps: + - name: Checkout Repo + uses: actions/checkout@v3 - # - name: Get Version Number - # shell: bash - # id: version_number - # run: .github/actions/get-version.sh windows x86-64 + - name: Get Version Number + shell: bash + id: version_number + run: .github/actions/get-version.sh windows x86-64 - # - name: Build - # shell: bash - # env: - # BB_ARTIFACT_NAME: ${{ env.BB_ARTIFACT_NAME }} - # BB_VERSION: ${{env.BB_VERSION}} - # run: | + - name: Build Bladebit + shell: bash + env: + BB_ARTIFACT_NAME: ${{ env.BB_ARTIFACT_NAME }} + BB_VERSION: ${{env.BB_VERSION}} + run: | - # mkdir build && cd build - # cmake .. - # bash -e -o pipefail ../embed-version.sh - # cat ../src/Version.h - # cmake --build . --target bladebit --config Release - - # # Ensure bladebit version matches expected version - # bb_version="$(./Release/bladebit.exe --version | xargs)" - - # if [[ "$bb_version" != "$BB_VERSION" ]]; then - # >&2 echo "Incorrect bladebit version. Got but '$bb_version' expected '$BB_VERSION'." - # exit 1 - # fi + mkdir build && cd build + cmake .. + bash -eo pipefail ../embed-version.sh + cat ../src/Version.h + cmake --build . --target bladebit --config Release + + # Ensure bladebit version matches expected version + bb_version="$(./Release/bladebit.exe --version | xargs)" + + if [[ "$bb_version" != "$BB_VERSION" ]]; then + >&2 echo "Incorrect bladebit version. Got but '$bb_version' expected '$BB_VERSION'." + exit 1 + fi - # mkdir ../bin - # cd Release - # ls -la - # 7z.exe a -tzip ../../bin/${BB_ARTIFACT_NAME} bladebit.exe - # ls -la ../../bin + mkdir ../bin + cd Release + ls -la + 7z.exe a -tzip ../../bin/${BB_ARTIFACT_NAME} bladebit.exe + ls -la ../../bin - # - name: Upload Artifact Windows x86-64 - # uses: actions/upload-artifact@v3 - # with: - # name: ${{ env.BB_ARTIFACT_NAME }} - # path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME }} - # if-no-files-found: error + - name: Upload Bladebit Artifact Windows x86-64 + uses: actions/upload-artifact@v3 + with: + name: ${{ env.BB_ARTIFACT_NAME }} + path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME }} + if-no-files-found: error + + build-bladebit-cuda-windows-x86-64: + runs-on: windows-2019 + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - name: Get Version Number + shell: bash + id: version_number + run: .github/actions/get-version.sh windows x86-64 + + - name: Install Prerequisites + shell: powershell + run: | + choco install -y make + choco install -y wget + choco install -y sed + + - name: Setup CUDA + uses: Jimver/cuda-toolkit@v0.2.10 + id: cuda-toolkit + with: + cuda: '12.1.0' + + - name: Verify CUDA + shell: bash + run: | + echo "Installed cuda version is: ${{ steps.cuda-toolkit.outputs.cuda }}" + echo "Cuda install location: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}" + nvcc -V + + - name: Build Bladebit CUDA + shell: bash + env: + BB_ARTIFACT_NAME_CUDA: ${{ env.BB_ARTIFACT_NAME_CUDA }} + BB_VERSION: ${{env.BB_VERSION}} + run: | + + mkdir build_cuda && cd build_cuda + cmake .. + bash -eo pipefail ../embed-version.sh + cat ../src/Version.h + cmake --build . --target bladebit_cuda --config Release + + # Ensure bladebit version matches expected version + bb_version="$(./Release/bladebit_cuda.exe --version | xargs)" + + if [[ "$bb_version" != "$BB_VERSION" ]]; then + >&2 echo "Incorrect bladebit version. Got but '$bb_version' expected '$BB_VERSION'." + exit 1 + fi + + mkdir ../bin + cd Release + ls -la + 7z.exe a -tzip ../../bin/${BB_ARTIFACT_NAME_CUDA} bladebit_cuda.exe + ls -la ../../bin + + - name: Upload Bladebit CUDA Artifact Windows x86-64 + uses: actions/upload-artifact@v3 + with: + name: ${{ env.BB_ARTIFACT_NAME_CUDA }} + path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME_CUDA }} + if-no-files-found: error # build-macos-arm64: # runs-on: [macOS, ARM64]