Skip to content

Commit

Permalink
Add GitHub Action PR workflow (#37)
Browse files Browse the repository at this point in the history
Add GitHub Action PR workflow
  • Loading branch information
ajschmidt8 authored Apr 28, 2023
1 parent 42f05b9 commit 87ca83b
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 68 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: pr

on:
push:
branches:
- "pull-request/[0-9]+"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pr-builder:
needs:
- checks
- cpp-build-test
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@branch-23.06
checks:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/checks.yaml@branch-23.06
with:
enable_check_generated_files: false
cpp-build-test:
needs: checks
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.06
with:
build_type: pull-request
test_script: ci/build_and_test.sh
matrix_filter: map(select(.ARCH == "amd64"))
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set -euo pipefail

mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_GTEST=ON -DBUILD_EXAMPLES=ON -DBUILD_BENCHMARKS=ON
Expand Down
31 changes: 31 additions & 0 deletions ci/build_and_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.
set -euo pipefail
. /opt/conda/etc/profile.d/conda.sh

rapids-logger "Generate C++ build & test dependencies"
rapids-dependency-file-generator \
--output conda \
--file_key build \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml

rapids-mamba-retry env create --force -f env.yaml -n test

# Temporarily allow unbound variables for conda activation.
set +u
conda activate test
set -u

rapids-print-env

rapids-logger "Check GPU usage"
nvidia-smi

rapids-logger "Build C++ targets"
./build.sh

rapids-logger "GoogleTest"
./build/TestGPUTreeShap

rapids-logger "Run Example"
./build/GPUTreeShapExample
12 changes: 3 additions & 9 deletions ci/checks/style.sh → ci/check_style.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
#!/bin/bash
# Copyright (c) 2020, NVIDIA CORPORATION.
#####################
# GPUTreeShap Style Tester #
#####################
# Copyright (c) 2023, NVIDIA CORPORATION.

# Ignore errors and set path
# Ignore errors
set +e
PATH=/opt/conda/bin:$PATH
RETVAL="0"

# Activate common conda env
. /opt/conda/etc/profile.d/conda.sh
conda activate rapids

# Check for a consistent code format
pip install cpplint
FORMAT=`cpplint --recursive GPUTreeShap tests example benchmark 2>&1`
FORMAT=$(cpplint --recursive GPUTreeShap tests example benchmark 2>&1)
FORMAT_RETVAL=$?
if [ "$RETVAL" = "0" ]; then
RETVAL=$FORMAT_RETVAL
Expand Down
59 changes: 0 additions & 59 deletions ci/gpu/build.sh

This file was deleted.

24 changes: 24 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dependency list for https://github.com/rapidsai/dependency-file-generator
files:
build:
output: none
includes:
- build
- docs
channels:
- rapidsai
- conda-forge
dependencies:
build:
common:
- output_types: [conda]
packages:
- binutils
- cmake
- gxx <=11
- make
docs:
common:
- output_types: [conda]
packages:
- doxygen

0 comments on commit 87ca83b

Please sign in to comment.