From a2c6d1e5b3f49aab865de1f51f5efe6496db2b3a Mon Sep 17 00:00:00 2001 From: KaffinPX <73744616+KaffinPX@users.noreply.github.com> Date: Tue, 30 May 2023 00:35:02 +0300 Subject: [PATCH 1/4] Add building in every commit --- .github/workflows/ci.yaml | 97 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 96 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 720f11e..8a37490 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,6 @@ name: Tests on: [push, pull_request] jobs: - check: name: Check runs-on: ubuntu-latest @@ -271,3 +270,99 @@ jobs: with: command: clippy args: --tests -- -D warnings + + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + # Build gnu-linux on ubuntu-18.04 and musl on ubuntu latest + os: [ ubuntu-18.04, windows-latest, macos-latest ] + features: ["default", "kaspacuda/overclock "] + name: Building, ${{ matrix.os }} ${{ matrix.features }} + steps: + - name: Fix CRLF on Windows + if: runner.os == 'Windows' + run: git config --global core.autocrlf false + + - name: Fix LibOpenCL on Linux + if: runner.os == 'Linux' + run: | + sudo apt update + sudo apt install ocl-icd-opencl-dev -y + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Install Protoc + uses: arduino/setup-protoc@v1 + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Install CUDA Linux + if: runner.os == 'Linux' + uses: Jimver/cuda-toolkit@v0.2.8 + with: + cuda: '11.2.2' + method: 'network' + sub-packages: '["nvcc", "cudart"]' + + - name: Install CUDA Windows + if: runner.os == 'Windows' + uses: Jimver/cuda-toolkit@v0.2.8 + with: + cuda: '11.5.1' + method: 'network' + sub-packages: '["nvcc", "cudart"]' + + - name: Build on Linux GNU + if: matrix.os == 'ubuntu-18.04' + # We're using musl to make the binaries statically linked and portable + run: | + cargo build --target=x86_64-unknown-linux-gnu --release --all --features ${{ matrix.features }} + feature_name=${{ matrix.features }} + asset_name="kaspa-miner-${{ github.event.release.tag_name }}-${feature_name/\//-}-linux-gnu-amd64" + strip ./target/x86_64-unknown-linux-gnu/release/kaspa-miner + mkdir ${asset_name} + mv ./target/x86_64-unknown-linux-gnu/release/kaspa-miner ${asset_name}/${asset_name} + mv ./target/x86_64-unknown-linux-gnu/release/libkaspa*.so ${asset_name}/ + tar czvf ${asset_name}.tgz ${asset_name} + echo "archive=${asset_name}.tgz" >> $GITHUB_ENV + echo "asset_name=${asset_name}.tgz" >> $GITHUB_ENV + + - name: Build on Windows + if: matrix.os == 'windows-latest' + shell: bash + run: | + cargo build --target=x86_64-pc-windows-msvc --release --all --features ${{ matrix.features }} + feature_name=${{ matrix.features }} + asset_name="kaspa-miner-${{ github.event.release.tag_name }}-${feature_name/\//-}-win64-amd64" + mkdir ${asset_name} + mv ./target/x86_64-pc-windows-msvc/release/kaspa-miner.exe ${asset_name}/${asset_name}.exe + mv ./target/x86_64-pc-windows-msvc/release/kaspa*.dll ${asset_name}/ + bash ./integrations/windows/create_bat.sh ${asset_name} + 7z a -tzip -r ${asset_name}.zip ${asset_name} + echo "archive=${asset_name}.zip" >> $GITHUB_ENV + echo "asset_name=${asset_name}.zip" >> $GITHUB_ENV + + - name: Build on MacOS + if: matrix.os == 'macos-latest' + run: | + cargo build --target=x86_64-apple-darwin --release -p kaspa-miner + asset_name="kaspa-miner-${{ github.event.release.tag_name }}-cpu-only-osx-amd64" + mkdir ${asset_name} + mv ./target/x86_64-apple-darwin/release/kaspa-miner ${asset_name}/${asset_name} + tar czvf ${asset_name}.tgz ${asset_name} + echo "archive=${asset_name}.tgz" >> $GITHUB_ENV + echo "asset_name=${asset_name}.tgz" >> $GITHUB_ENV + + - name: Upload binary to GitHub + uses: actions/upload-artifact@v3 + with: + name: "${{ env.asset_name }}" + path: "./${{ env.archive }}" From 3cebed6e4d6d03afffba7bf44bafe4f9aeca726a Mon Sep 17 00:00:00 2001 From: KaffinPX <73744616+KaffinPX@users.noreply.github.com> Date: Tue, 30 May 2023 00:44:22 +0300 Subject: [PATCH 2/4] Retry --- .github/workflows/ci.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8a37490..d1259e1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,7 +21,7 @@ jobs: override: true - name: Install cuda - uses: Jimver/cuda-toolkit@v0.2.8 + uses: Jimver/cuda-toolkit@v0.2.10 with: cuda: '11.2.2' method: 'network' @@ -77,7 +77,7 @@ jobs: - name: Install CUDA Linux if: runner.os == 'Linux' - uses: Jimver/cuda-toolkit@v0.2.8 + uses: Jimver/cuda-toolkit@v0.2.10 with: cuda: '11.2.2' method: 'network' @@ -85,7 +85,7 @@ jobs: - name: Install CUDA Windows if: runner.os == 'Windows' - uses: Jimver/cuda-toolkit@v0.2.8 + uses: Jimver/cuda-toolkit@v0.2.10 with: cuda: '11.5.1' method: 'network' @@ -167,7 +167,7 @@ jobs: - name: Install CUDA Linux if: runner.os == 'Linux' - uses: Jimver/cuda-toolkit@v0.2.8 + uses: Jimver/cuda-toolkit@v0.2.10 with: cuda: '11.2.2' method: 'network' @@ -175,7 +175,7 @@ jobs: - name: Install CUDA Windows if: runner.os == 'Windows' - uses: Jimver/cuda-toolkit@v0.2.8 + uses: Jimver/cuda-toolkit@v0.2.10 with: cuda: '11.5.1' method: 'network' @@ -241,7 +241,7 @@ jobs: components: rustfmt, clippy - name: Install cuda - uses: Jimver/cuda-toolkit@v0.2.8 + uses: Jimver/cuda-toolkit@v0.2.10 with: cuda: '11.2.2' method: 'network' @@ -279,7 +279,7 @@ jobs: # Build gnu-linux on ubuntu-18.04 and musl on ubuntu latest os: [ ubuntu-18.04, windows-latest, macos-latest ] features: ["default", "kaspacuda/overclock "] - name: Building, ${{ matrix.os }} ${{ matrix.features }} + name: Building debug binary of ${{ matrix.os }} ${{ matrix.features }} steps: - name: Fix CRLF on Windows if: runner.os == 'Windows' @@ -306,7 +306,7 @@ jobs: - name: Install CUDA Linux if: runner.os == 'Linux' - uses: Jimver/cuda-toolkit@v0.2.8 + uses: Jimver/cuda-toolkit@v0.2.10 with: cuda: '11.2.2' method: 'network' @@ -314,7 +314,7 @@ jobs: - name: Install CUDA Windows if: runner.os == 'Windows' - uses: Jimver/cuda-toolkit@v0.2.8 + uses: Jimver/cuda-toolkit@v0.2.10 with: cuda: '11.5.1' method: 'network' From d9888eb64d1394c7c0b94cfaf3c4bf4824547df8 Mon Sep 17 00:00:00 2001 From: KaffinPX <73744616+KaffinPX@users.noreply.github.com> Date: Tue, 30 May 2023 01:07:39 +0300 Subject: [PATCH 3/4] Update ci.yaml --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d1259e1..551d8d0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -277,7 +277,7 @@ jobs: fail-fast: false matrix: # Build gnu-linux on ubuntu-18.04 and musl on ubuntu latest - os: [ ubuntu-18.04, windows-latest, macos-latest ] + os: [ ubuntu-18.04, windows-2019, macos-latest ] features: ["default", "kaspacuda/overclock "] name: Building debug binary of ${{ matrix.os }} ${{ matrix.features }} steps: From aaed0aeda4d326770ef24a98032d52faba59ecda Mon Sep 17 00:00:00 2001 From: KaffinPX <73744616+KaffinPX@users.noreply.github.com> Date: Tue, 30 May 2023 01:15:17 +0300 Subject: [PATCH 4/4] Update ci.yaml --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 551d8d0..c73e121 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -364,5 +364,5 @@ jobs: - name: Upload binary to GitHub uses: actions/upload-artifact@v3 with: - name: "${{ env.asset_name }}" - path: "./${{ env.archive }}" + name: "${{ runner.os }} binary" + path: "./${{ env.archive }}/"