Files
nvbench/.github/workflows/pr.yml
Workflow config file is invalid. Please check your config file: yaml: unmarshal errors: line 30: mapping key "defaults" already defined at line 19
2025-12-03 10:30:27 -05:00

133 lines
4.0 KiB
YAML

# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This is the main workflow that runs on every PR and push to main
name: Pull Request
defaults:
run:
shell: bash -euo pipefail {0}
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
jobs:
# Build wheels for all CUDA/Python combinations
build-wheels:
name: Build wheel (CUDA ${{ matrix.cuda }}, Python ${{ matrix.python }})
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
cuda: ['12', '13']
python: ['3.10', '3.11', '3.12', '3.13']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build wheel
run: |
bash ci/build_pynvbench_wheel.sh -py-version ${{ matrix.python }} -cuda-version ${{ matrix.cuda }}
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheel-pynvbench-cu${{ matrix.cuda }}-py${{ matrix.python }}
path: wheelhouse/*.whl
retention-days: 7
if-no-files-found: error
# Test wheels for all CUDA/Python combinations
test-wheels:
name: Test wheel (CUDA ${{ matrix.cuda }}, Python ${{ matrix.python }})
needs: build-wheels
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
cuda: ['12', '13']
python: ['3.10', '3.11', '3.12', '3.13']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Download wheel artifact
uses: actions/download-artifact@v4
with:
name: wheel-pynvbench-cu${{ matrix.cuda }}-py${{ matrix.python }}
path: /home/coder/nvbench/wheel-pynvbench-cu${{ matrix.cuda }}-py${{ matrix.python }}
- name: Test wheel
run: |
# Use the same rapidsai/ci-wheel Docker image as build
if [[ "${{ matrix.cuda }}" == "12" ]]; then
cuda_full_version="12.9.1"
else
cuda_full_version="13.0.1"
fi
docker run --rm \
--workdir /home/coder/nvbench \
--mount type=bind,source=$(pwd),target=/home/coder/nvbench/ \
--env py_version=${{ matrix.python }} \
--env cuda_version=${{ matrix.cuda }} \
rapidsai/ci-wheel:25.12-cuda${cuda_full_version}-rockylinux8-py${{ matrix.python }} \
/home/coder/nvbench/ci/test_pynvbench.sh -py-version ${{ matrix.python }} -cuda-version ${{ matrix.cuda }}
verify-workflow:
name: Verify all builds and tests succeeded
if: ${{ always() }}
needs:
- build-wheels
- test-wheels
runs-on: ubuntu-latest
steps:
- name: Check build results
run: |
if [[ "${{ needs.build-wheels.result }}" != "success" ]]; then
echo "Wheel builds failed!"
exit 1
fi
if [[ "${{ needs.test-wheels.result }}" != "success" ]]; then
echo "Wheel tests failed!"
exit 1
fi
echo "All wheels built and tested successfully!"