|
| 1 | +name: Build and Release |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - '*' |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + name: Build and Release |
| 13 | + runs-on: runs-on=${{ github.run_id }}/runner=gpu/tag=cudf-test-harness |
| 14 | + container: |
| 15 | + image: nvidia/cuda:13.1.0-devel-ubuntu24.04 |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: runs-on/action@v2 |
| 19 | + with: |
| 20 | + sccache: s3 |
| 21 | + |
| 22 | + - name: Configure sccache timeout |
| 23 | + run: | |
| 24 | + mkdir -p ~/.config/sccache |
| 25 | + echo 'server_startup_timeout_ms = 60000' > ~/.config/sccache/config |
| 26 | +
|
| 27 | + - name: Install sccache |
| 28 | + uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 |
| 29 | + |
| 30 | + - name: Pre-start sccache server |
| 31 | + run: sccache --start-server |
| 32 | + |
| 33 | + - name: Install build tools |
| 34 | + run: | |
| 35 | + apt-get update |
| 36 | + apt-get install -y --no-install-recommends \ |
| 37 | + ca-certificates \ |
| 38 | + curl |
| 39 | + curl -fsSL https://apt.kitware.com/keys/kitware-archive-latest.asc -o /usr/share/keyrings/kitware-archive-keyring.asc |
| 40 | + echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.asc] https://apt.kitware.com/ubuntu/ noble main' > /etc/apt/sources.list.d/kitware.list |
| 41 | + apt-get update |
| 42 | + apt-get install -y --no-install-recommends \ |
| 43 | + build-essential \ |
| 44 | + cmake \ |
| 45 | + git \ |
| 46 | + ninja-build \ |
| 47 | + tar \ |
| 48 | + zlib1g-dev |
| 49 | + cmake --version |
| 50 | + /usr/local/cuda/bin/nvcc --version |
| 51 | +
|
| 52 | + - name: Checkout |
| 53 | + uses: actions/checkout@v4 |
| 54 | + |
| 55 | + - name: Build |
| 56 | + run: | |
| 57 | + cmake -S . -B build -G Ninja \ |
| 58 | + -DCMAKE_BUILD_TYPE=Release \ |
| 59 | + -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \ |
| 60 | + -DCMAKE_C_COMPILER_LAUNCHER=sccache \ |
| 61 | + -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ |
| 62 | + -DCMAKE_CUDA_COMPILER_LAUNCHER=sccache \ |
| 63 | + -DBUILD_TEST_LIB=OFF |
| 64 | + cmake --build build |
| 65 | +
|
| 66 | + - name: Create bundle |
| 67 | + run: | |
| 68 | + chmod +x scripts/bundle.sh |
| 69 | + ./scripts/bundle.sh |
| 70 | +
|
| 71 | + - name: Verify bundle |
| 72 | + run: | |
| 73 | + rm -rf /tmp/cudf-test-harness-bundle |
| 74 | + mkdir -p /tmp/cudf-test-harness-bundle |
| 75 | + tar -xzf build/bundle/cudf-test-harness-*.tar.gz -C /tmp/cudf-test-harness-bundle |
| 76 | + BINARY="$(echo /tmp/cudf-test-harness-bundle/*/cudf-test-harness)" |
| 77 | + readelf -d "$BINARY" | grep -F '$ORIGIN/lib' |
| 78 | + OUTPUT="$("$BINARY" 2>&1 || true)" |
| 79 | + echo "$OUTPUT" | grep 'Usage:' |
| 80 | +
|
| 81 | + - name: Upload artifact |
| 82 | + if: startsWith(github.ref, 'refs/tags/') |
| 83 | + uses: actions/upload-artifact@v4 |
| 84 | + with: |
| 85 | + name: cudf-test-harness-linux-x86_64 |
| 86 | + path: build/bundle/*.tar.gz |
| 87 | + |
| 88 | + - name: Release |
| 89 | + if: startsWith(github.ref, 'refs/tags/') |
| 90 | + uses: softprops/action-gh-release@v1 |
| 91 | + with: |
| 92 | + files: build/bundle/*.tar.gz |
| 93 | + env: |
| 94 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments