Skip to content

Commit

Permalink
First pass at adding CI
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Jan 16, 2025
1 parent 08b8ad9 commit 6eba744
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,13 @@ jobs:
container:
image: rapidsai/ci-conda:latest
steps:
- name: Test workflow existence
run: echo "Workflow exists"
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-0|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run ci/check_style.sh
run: ci/check_style.sh
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,8 @@ repos:
- id: codespell
additional_dependencies: [tomli]
args: ["--toml", "pyproject.toml"]
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.16.0
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
28 changes: 28 additions & 0 deletions ci/check_style.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
# Copyright (c) 2025, NVIDIA CORPORATION.

set -euo pipefail

rapids-logger "Create checks conda environment"
. /opt/conda/etc/profile.d/conda.sh

ENV_YAML_DIR="$(mktemp -d)"

rapids-dependency-file-generator \
--output conda \
--file-key checks \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee "${ENV_YAML_DIR}/env.yaml"

rapids-mamba-retry env create --yes -f "${ENV_YAML_DIR}/env.yaml" -n checks
conda activate checks

# TODO: Figure out the long-term plan here since the VERSION file should probably go.
RAPIDS_VERSION_MAJOR_MINOR="$(rapids-version-major-minor)"

FORMAT_FILE_URL="https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-${RAPIDS_VERSION_MAJOR_MINOR}/cmake-format-rapids-cmake.json"
export RAPIDS_CMAKE_FORMAT_FILE=/tmp/rapids_cmake_ci/cmake-formats-rapids-cmake.json
mkdir -p $(dirname ${RAPIDS_CMAKE_FORMAT_FILE})
wget -O ${RAPIDS_CMAKE_FORMAT_FILE} ${FORMAT_FILE_URL}

# Run pre-commit checks
pre-commit run --all-files --show-diff-on-failure
18 changes: 18 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Dependency list for https://github.com/rapidsai/dependency-file-generator
files:
checks:
output: none
includes:
- develop
channels:
- conda-forge
dependencies:
develop:
common:
- output_types: [conda, requirements]
packages:
- pre-commit
# pre-commit requires identify minimum version 1.0, but clang-format requires textproto support and that was
# added in 2.5.20, so we need to call out the minimum version needed for our plugins
- identify>=2.5.20
- python>=3.10

0 comments on commit 6eba744

Please sign in to comment.