From f967fc64f50dcb72b5c3f13d4795cdc39c6615c8 Mon Sep 17 00:00:00 2001 From: Christopher Harris Date: Wed, 6 Dec 2023 17:43:13 +0000 Subject: [PATCH] add pre-commit to ci checks --- .github/workflows/pull_request.yml | 5 +++++ ci/check_style.sh | 18 ++++++++++++++++++ dependencies.yaml | 14 +++++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 ci/check_style.sh diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index dd5b73dd3..acb67bd32 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -80,3 +80,8 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} CONDA_TOKEN: ${{ secrets.CONDA_TOKEN }} NGC_API_KEY: ${{ secrets.NGC_API_KEY }} + checks: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.02 + with: + enable_check_generated_files: false diff --git a/ci/check_style.sh b/ci/check_style.sh new file mode 100644 index 000000000..0ee6e88e5 --- /dev/null +++ b/ci/check_style.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Copyright (c) 2020-2023, NVIDIA CORPORATION. + +set -euo pipefail + +rapids-logger "Create checks conda environment" +. /opt/conda/etc/profile.d/conda.sh + +rapids-dependency-file-generator \ + --output conda \ + --file_key checks \ + --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml + +rapids-mamba-retry env create --force -f env.yaml -n checks +conda activate checks + +# Run pre-commit checks +pre-commit run --all-files --show-diff-on-failure diff --git a/dependencies.yaml b/dependencies.yaml index 4d81d058c..8d6f0d3b2 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -7,6 +7,7 @@ files: arch: [x86_64] includes: - build + - checks - developer_productivity - code_style - testing @@ -30,6 +31,12 @@ files: - documentation - cudatoolkit + checks: + output: none + includes: + - checks + + channels: - conda-forge - rapidsai @@ -62,6 +69,12 @@ dependencies: - scikit-build>=0.17 - ucx=1.14 + checks: + common: + - output_types: [conda] + packages: + - pre-commit + developer_productivity: common: - output_types: [conda] @@ -75,7 +88,6 @@ dependencies: - libclang-cpp=16 - libclang=16 - llvmdev=16 - - pre-commit code_style: common: