fix ci (#32)
This commit is contained in:
+34
-61
@@ -45,15 +45,28 @@ jobs:
|
||||
name: 🛠️ Build & Test
|
||||
needs: fast-checks
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
features: ["", "gpu"]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: setup rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
- name: compile
|
||||
run: cargo build --locked --workspace
|
||||
- name: compile (${{ matrix.features || 'cpu-only' }})
|
||||
run: |
|
||||
if [ -n "${{ matrix.features }}" ]; then
|
||||
cargo build --locked --workspace --features ${{ matrix.features }}
|
||||
else
|
||||
cargo build --locked --workspace
|
||||
fi
|
||||
timeout-minutes: 90
|
||||
- name: test
|
||||
run: cargo test --locked --workspace
|
||||
- name: test (${{ matrix.features || 'cpu-only' }})
|
||||
run: |
|
||||
if [ -n "${{ matrix.features }}" ]; then
|
||||
cargo test --locked --workspace --features ${{ matrix.features }}
|
||||
else
|
||||
cargo test --locked --workspace
|
||||
fi
|
||||
timeout-minutes: 15
|
||||
|
||||
analysis:
|
||||
@@ -66,64 +79,24 @@ jobs:
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
components: clippy
|
||||
- name: clippy
|
||||
run: cargo clippy --locked --workspace
|
||||
- name: clippy (all features)
|
||||
run: cargo clippy --locked --workspace --all-features
|
||||
timeout-minutes: 30
|
||||
- name: doc
|
||||
run: cargo doc --locked --workspace --no-deps
|
||||
run: cargo doc --locked --workspace --no-deps --all-features
|
||||
timeout-minutes: 15
|
||||
|
||||
# cuda-build:
|
||||
# name: 🚀 CUDA Build (cuda=${{ matrix.cuda_tag }} sm=${{ matrix.sm }})
|
||||
# needs: fast-checks
|
||||
# runs-on: ubuntu-latest
|
||||
# strategy:
|
||||
# fail-fast: false
|
||||
# matrix:
|
||||
# cuda_tag: ["12.9.0", "13.0.0"]
|
||||
# sm: ["86", "89", "120"]
|
||||
# steps:
|
||||
# - name: Checkout repository
|
||||
# uses: actions/checkout@v4
|
||||
# - name: Check if cuda-builder image exists
|
||||
# id: check-image
|
||||
# run: |
|
||||
# if docker manifest inspect ghcr.io/quantus-network/cuda-builder:${{ matrix.cuda_tag }} >/dev/null 2>&1; then
|
||||
# echo "exists=true" >> "$GITHUB_OUTPUT"
|
||||
# echo "✅ CUDA builder image exists for ${{ matrix.cuda_tag }}"
|
||||
# else
|
||||
# echo "exists=false" >> "$GITHUB_OUTPUT"
|
||||
# echo "⚠️ CUDA builder image not found for ${{ matrix.cuda_tag }}, skipping build"
|
||||
# fi
|
||||
# - name: Build with cuda-builder image
|
||||
# if: steps.check-image.outputs.exists == 'true'
|
||||
# id: build
|
||||
# env:
|
||||
# CUDA_TAG: ${{ matrix.cuda_tag }}
|
||||
# SM: ${{ matrix.sm }}
|
||||
# GITHUB_SHA: ${{ github.sha }}
|
||||
# run: |
|
||||
# set -eux
|
||||
# SHORT_TAG="$(echo "${CUDA_TAG}" | sed -E 's/^([0-9]+\.[0-9]+).*/\1/')"
|
||||
# BIN="quantus-miner-cuda-${SHORT_TAG}-sm-${SM}"
|
||||
# mkdir -p .cargo-cache target
|
||||
# docker run --rm \
|
||||
# -e CUDA_ARCH=sm_${SM} \
|
||||
# -e CARGO_TERM_COLOR=always \
|
||||
# -e GITHUB_SHA="${GITHUB_SHA}" \
|
||||
# -v "${PWD}:/workspace" \
|
||||
# -v "${PWD}/.cargo-cache:/opt/cargo/registry" \
|
||||
# -v "${PWD}/target:/workspace/target" \
|
||||
# ghcr.io/quantus-network/cuda-builder:${CUDA_TAG} \
|
||||
# bash -lc 'cd /workspace && echo "CUDA version:" && nvcc --version && cargo build -p miner-cli --features cuda --release && strip target/release/quantus-miner || true'
|
||||
# install -m 0755 ./target/release/quantus-miner "./${BIN}"
|
||||
# echo "bin_path=./${BIN}" >> "$GITHUB_OUTPUT"
|
||||
# echo "short_tag=${SHORT_TAG}" >> "$GITHUB_OUTPUT"
|
||||
# - name: Upload artifact
|
||||
# if: steps.check-image.outputs.exists == 'true'
|
||||
# uses: actions/upload-artifact@v4
|
||||
# with:
|
||||
# name: ${{ format('quantus-miner-cuda-{0}-sm-{1}', steps.build.outputs.short_tag, matrix.sm) }}
|
||||
# path: ${{ steps.build.outputs.bin_path }}
|
||||
# if-no-files-found: error
|
||||
# retention-days: 3
|
||||
benchmark:
|
||||
name: 🏃 Benchmark
|
||||
needs: fast-checks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: setup rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
- name: build benchmark binary
|
||||
run: cargo build -p miner-cli --release --features gpu
|
||||
timeout-minutes: 60
|
||||
- name: run cpu benchmark
|
||||
run: ./target/release/quantus-miner benchmark --cpu-workers 2 --duration 5
|
||||
timeout-minutes: 10
|
||||
|
||||
Reference in New Issue
Block a user