Skip to content

Commit a3a4206

Browse files
authored
Merge pull request #349 from rapidsai/enable-pre-commit
Enable pre-commit rules.
2 parents 35e0ffc + 22ed31a commit a3a4206

20 files changed

+192
-89
lines changed

.github/actionlint.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Configuration related to self-hosted runners.
2+
self-hosted-runner:
3+
# Labels of self-hosted runner in array of strings.
4+
labels:
5+
- linux-amd64-*
6+
- linux-arm64-*
7+
8+
# Configuration variables in array of strings defined in your repository or organization.
9+
config-variables:
10+
- AWS_REGION
11+
- AWS_ROLE_ARN
12+
- TELEMETRY_ENABLED

.github/workflows/breaking-change-alert.yaml

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,23 @@ jobs:
7373
echo "$1" | jq ${flag} -c . | grep -E '^".*"$' | awk '{print substr($0, 2, length($0) - 2)}' && [ "${PIPESTATUS[2]}" -eq 0 ]
7474
}
7575
76-
# Escape all input variables
77-
echo "sender_login=$(escape_json "${SENDER_LOGIN}")" >> $GITHUB_OUTPUT
78-
echo "sender_avatar=$(escape_json "${SENDER_AVATAR}")" >> $GITHUB_OUTPUT
79-
echo "repo=$(escape_json "${REPO}")" >> $GITHUB_OUTPUT
80-
echo "pr_number=${PR_NUMBER}" >> $GITHUB_OUTPUT
81-
echo "pr_title=$(escape_json "${PR_TITLE}")" >> $GITHUB_OUTPUT
82-
echo "pr_body=$(escape_json "${PR_BODY}" slurp)" >> $GITHUB_OUTPUT
83-
echo "pr_base_ref=$(escape_json "${PR_BASE_REF}")" >> $GITHUB_OUTPUT
84-
echo "pr_author=$(escape_json "${PR_AUTHOR}")" >> $GITHUB_OUTPUT
76+
{
77+
# Escape all input variables
78+
echo "sender_login=$(escape_json "${SENDER_LOGIN}")"
79+
echo "sender_avatar=$(escape_json "${SENDER_AVATAR}")"
80+
echo "repo=$(escape_json "${REPO}")"
81+
echo "pr_number=${PR_NUMBER}"
82+
echo "pr_title=$(escape_json "${PR_TITLE}")"
83+
echo "pr_body=$(escape_json "${PR_BODY}" slurp)"
84+
echo "pr_base_ref=$(escape_json "${PR_BASE_REF}")"
85+
echo "pr_author=$(escape_json "${PR_AUTHOR}")"
8586
86-
# Create escaped URLs
87-
echo "repo_url=$(escape_json "https://github.com/${REPO}")" >> $GITHUB_OUTPUT
88-
echo "pr_url=$(escape_json "https://github.com/${REPO}/pull/${PR_NUMBER}")" >> $GITHUB_OUTPUT
89-
echo "branch_url=$(escape_json "https://github.com/${REPO}/tree/${PR_BASE_REF}")" >> $GITHUB_OUTPUT
90-
echo "author_url=$(escape_json "https://github.com/${PR_AUTHOR}")" >> $GITHUB_OUTPUT
87+
# Create escaped URLs
88+
echo "repo_url=$(escape_json "https://github.com/${REPO}")"
89+
echo "pr_url=$(escape_json "https://github.com/${REPO}/pull/${PR_NUMBER}")"
90+
echo "branch_url=$(escape_json "https://github.com/${REPO}/tree/${PR_BASE_REF}")"
91+
echo "author_url=$(escape_json "https://github.com/${PR_AUTHOR}")"
92+
} >> "${GITHUB_OUTPUT}"
9193
9294
- name: Determine notification parameters
9395
id: notification
@@ -96,21 +98,29 @@ jobs:
9698
PR_MERGED: ${{ inputs.pr_merged }}
9799
run: |
98100
if [[ "$EVENT_ACTION" == "closed" && "$PR_MERGED" == "true" ]]; then
99-
echo "action=Merged" >> $GITHUB_OUTPUT
100-
echo "color=#D00000" >> $GITHUB_OUTPUT
101-
echo "icon=:rocket:" >> $GITHUB_OUTPUT
101+
{
102+
echo "action=Merged"
103+
echo "color=#D00000"
104+
echo "icon=:rocket:"
105+
} >> "${GITHUB_OUTPUT}"
102106
elif [[ "$EVENT_ACTION" == "closed" ]]; then
103-
echo "action=Closed" >> $GITHUB_OUTPUT
104-
echo "color=#1d9bd1" >> $GITHUB_OUTPUT
105-
echo "icon=:information_source:" >> $GITHUB_OUTPUT
107+
{
108+
echo "action=Closed"
109+
echo "color=#1d9bd1"
110+
echo "icon=:information_source:"
111+
} >> "${GITHUB_OUTPUT}"
106112
elif [[ "$EVENT_ACTION" == "reopened" ]]; then
107-
echo "action=Reopened" >> $GITHUB_OUTPUT
108-
echo "color=warning" >> $GITHUB_OUTPUT
109-
echo "icon=:warning:" >> $GITHUB_OUTPUT
113+
{
114+
echo "action=Reopened"
115+
echo "color=warning"
116+
echo "icon=:warning:"
117+
} >> "${GITHUB_OUTPUT}"
110118
else
111-
echo "action=Modified" >> $GITHUB_OUTPUT
112-
echo "color=good" >> $GITHUB_OUTPUT
113-
echo "icon=:information_source:" >> $GITHUB_OUTPUT
119+
{
120+
echo "action=Modified"
121+
echo "color=good"
122+
echo "icon=:information_source:"
123+
} >> "${GITHUB_OUTPUT}"
114124
fi
115125
116126
- name: Send Slack notification

.github/workflows/build-in-devcontainer.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ jobs:
8585

8686
- name: Check if repo has devcontainer
8787
run: |
88-
echo "REPOSITORY=$(basename "$(pwd)")" | tee -a "${GITHUB_ENV}";
88+
echo "REPOSITORY=$(basename "$(pwd)")" | tee -a "${GITHUB_ENV}"
8989
if test -f .devcontainer/cuda${{ matrix.CUDA_VER }}-${{ matrix.PACKAGER }}/devcontainer.json; then
90-
echo "HAS_DEVCONTAINER=true" >> "${GITHUB_ENV}";
90+
echo "HAS_DEVCONTAINER=true" >> "${GITHUB_ENV}"
9191
else
92-
echo "HAS_DEVCONTAINER=false" >> "${GITHUB_ENV}";
92+
echo "HAS_DEVCONTAINER=false" >> "${GITHUB_ENV}"
9393
fi
9494
- if: ${{ env.HAS_DEVCONTAINER == 'true' }}
9595
uses: aws-actions/configure-aws-credentials@v4

.github/workflows/changed-files.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
PR_SHA: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).head.sha }}
6666
BASE_SHA: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.sha }}
6767
run: |
68-
(echo -n "merge-base="; git merge-base "$BASE_SHA" "$PR_SHA") | tee --append "$GITHUB_OUTPUT"
68+
(echo -n "merge-base="; git merge-base "$BASE_SHA" "$PR_SHA") | tee --append "${GITHUB_OUTPUT}"
6969
- name: Get changed files
7070
id: changed-files
7171
uses: step-security/changed-files@95b56dadb92a30ca9036f16423fd3c088a71ee94 # v46.0.5
@@ -85,7 +85,7 @@ jobs:
8585
key="$(echo "$file" | sed -E 's/^\.github\/outputs\/(.*)\.json$/\1/g')"
8686
file_args=("${file_args[@]}" --slurpfile "$key" "$file")
8787
done
88-
(echo -n "transformed-output="; jq -c -n "\$ARGS.named | to_entries | map({"key": .key, "value": .value[]}) | from_entries | $TRANSFORM_EXPR" "${file_args[@]}") | tee --append "$GITHUB_OUTPUT"
88+
(echo -n "transformed-output="; jq -c -n "\$ARGS.named | to_entries | map({\"key\": .key, \"value\": .value[]}) | from_entries | $TRANSFORM_EXPR" "${file_args[@]}") | tee --append "${GITHUB_OUTPUT}"
8989
- name: Telemetry upload attributes
9090
uses: rapidsai/shared-actions/telemetry-dispatch-stash-job-artifacts@main
9191
continue-on-error: true

.github/workflows/conda-cpp-build.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,17 @@ jobs:
105105
ref: ${{ inputs.sha }}
106106
fetch-depth: 0
107107
- name: Standardize repository information
108+
env:
109+
RAPIDS_REPOSITORY: ${{ inputs.repo || github.repository }}
110+
RAPIDS_REF_NAME: ${{ inputs.branch || github.ref_name }}
111+
RAPIDS_NIGHTLY_DATE: ${{ inputs.date }}
108112
run: |
109-
echo "RAPIDS_REPOSITORY=${{ inputs.repo || github.repository }}" >> "${GITHUB_ENV}"
110-
echo "RAPIDS_SHA=$(git rev-parse HEAD)" >> "${GITHUB_ENV}"
111-
echo "RAPIDS_REF_NAME=${{ inputs.branch || github.ref_name }}" >> "${GITHUB_ENV}"
112-
echo "RAPIDS_NIGHTLY_DATE=${{ inputs.date }}" >> "${GITHUB_ENV}"
113+
{
114+
echo "RAPIDS_REPOSITORY=${RAPIDS_REPOSITORY}"
115+
echo "RAPIDS_SHA=$(git rev-parse HEAD)"
116+
echo "RAPIDS_REF_NAME=${RAPIDS_REF_NAME}"
117+
echo "RAPIDS_NIGHTLY_DATE=${RAPIDS_NIGHTLY_DATE}"
118+
} >> "${GITHUB_ENV}"
113119
114120
- name: Setup proxy cache
115121
uses: nv-gha-runners/setup-proxy-cache@main
@@ -131,7 +137,7 @@ jobs:
131137
GH_TOKEN: ${{ github.token }}
132138
- name: Get Package Name and Location
133139
if: ${{ inputs.upload-artifacts }}
134-
run: |
140+
run: |
135141
echo "RAPIDS_PACKAGE_NAME=$(RAPIDS_NO_PKG_EXTENSION=true rapids-package-name conda_cpp)" >> "${GITHUB_OUTPUT}"
136142
echo "CONDA_OUTPUT_DIR=${RAPIDS_CONDA_BLD_OUTPUT_DIR}" >> "${GITHUB_OUTPUT}"
137143
id: package-name
@@ -148,7 +154,7 @@ jobs:
148154
path: ${{ steps.package-name.outputs.CONDA_OUTPUT_DIR }}
149155
- name: Upload additional artifacts
150156
if: "!cancelled()"
151-
run: rapids-upload-artifacts-dir cuda${RAPIDS_CUDA_VERSION%%.*}_$(arch)
157+
run: rapids-upload-artifacts-dir "cuda${RAPIDS_CUDA_VERSION%%.*}_$(arch)"
152158
- name: Telemetry upload attributes
153159
uses: rapidsai/shared-actions/telemetry-dispatch-stash-job-artifacts@main
154160
continue-on-error: true

.github/workflows/conda-cpp-post-build-checks.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,17 @@ jobs:
6464
continue-on-error: true
6565
if: ${{ vars.TELEMETRY_ENABLED == 'true' && github.run_attempt == '1' }}
6666
- name: Standardize repository information
67+
env:
68+
RAPIDS_REPOSITORY: ${{ inputs.repo || github.repository }}
69+
RAPIDS_REF_NAME: ${{ inputs.branch || github.ref_name }}
70+
RAPIDS_NIGHTLY_DATE: ${{ inputs.date }}
6771
run: |
68-
echo "RAPIDS_REPOSITORY=${{ inputs.repo || github.repository }}" >> "${GITHUB_ENV}"
69-
echo "RAPIDS_SHA=$(cd ./src && git rev-parse HEAD)" >> "${GITHUB_ENV}"
70-
echo "RAPIDS_REF_NAME=${{ inputs.branch || github.ref_name }}" >> "${GITHUB_ENV}"
71-
echo "RAPIDS_NIGHTLY_DATE=${{ inputs.date }}" >> "${GITHUB_ENV}"
72+
{
73+
echo "RAPIDS_REPOSITORY=${RAPIDS_REPOSITORY}"
74+
echo "RAPIDS_SHA=$(cd ./src && git rev-parse HEAD)"
75+
echo "RAPIDS_REF_NAME=${RAPIDS_REF_NAME}"
76+
echo "RAPIDS_NIGHTLY_DATE=${RAPIDS_NIGHTLY_DATE}"
77+
} >> "${GITHUB_ENV}"
7278
- name: Download conda C++ build artifacts
7379
env:
7480
GH_TOKEN: ${{ github.token }}
@@ -88,9 +94,9 @@ jobs:
8894
SYMBOL_EXCLUSIONS: ${{ inputs.symbol_exclusions }}
8995
run: |
9096
if [ -n "${SYMBOL_EXCLUSIONS}" ]; then
91-
python ./tool/detect.py ${RAPIDS_EXTRACTED_DIR}/lib -e "${SYMBOL_EXCLUSIONS}"
97+
python ./tool/detect.py "${RAPIDS_EXTRACTED_DIR}"/lib -e "${SYMBOL_EXCLUSIONS}"
9298
else
93-
python ./tool/detect.py ${RAPIDS_EXTRACTED_DIR}/lib
99+
python ./tool/detect.py "${RAPIDS_EXTRACTED_DIR}"/lib
94100
fi
95101
- name: Telemetry upload attributes
96102
uses: rapidsai/shared-actions/telemetry-dispatch-stash-job-artifacts@main

.github/workflows/conda-cpp-tests.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,19 @@ jobs:
154154
if: ${{ vars.TELEMETRY_ENABLED == 'true' && github.run_attempt == '1'}}
155155
with:
156156
extra_attributes: "rapids.PACKAGER=conda,rapids.CUDA_VER=${{ matrix.CUDA_VER }},rapids.PY_VER=${{ matrix.PY_VER }},rapids.ARCH=${{ matrix.ARCH }},rapids.LINUX_VER=${{ matrix.LINUX_VER }},rapids.GPU=${{ matrix.GPU }},rapids.DRIVER=${{ matrix.DRIVER }},rapids.DEPENDENCIES=${{ matrix.DEPENDENCIES }}"
157+
157158
- name: Standardize repository information
159+
env:
160+
RAPIDS_REPOSITORY: ${{ inputs.repo || github.repository }}
161+
RAPIDS_REF_NAME: ${{ inputs.branch || github.ref_name }}
162+
RAPIDS_NIGHTLY_DATE: ${{ inputs.date }}
158163
run: |
159-
echo "RAPIDS_REPOSITORY=${{ inputs.repo || github.repository }}" >> "${GITHUB_ENV}"
160-
echo "RAPIDS_SHA=$(git rev-parse HEAD)" >> "${GITHUB_ENV}"
161-
echo "RAPIDS_REF_NAME=${{ inputs.branch || github.ref_name }}" >> "${GITHUB_ENV}"
162-
echo "RAPIDS_NIGHTLY_DATE=${{ inputs.date }}" >> "${GITHUB_ENV}"
164+
{
165+
echo "RAPIDS_REPOSITORY=${RAPIDS_REPOSITORY}"
166+
echo "RAPIDS_SHA=$(git rev-parse HEAD)"
167+
echo "RAPIDS_REF_NAME=${RAPIDS_REF_NAME}"
168+
echo "RAPIDS_NIGHTLY_DATE=${RAPIDS_NIGHTLY_DATE}"
169+
} >> "${GITHUB_ENV}"
163170
164171
- name: Setup proxy cache
165172
uses: nv-gha-runners/setup-proxy-cache@main
@@ -176,7 +183,7 @@ jobs:
176183
if: always()
177184
- name: Upload additional artifacts
178185
if: "!cancelled()"
179-
run: rapids-upload-artifacts-dir cuda${RAPIDS_CUDA_VERSION%%.*}_$(arch)
186+
run: rapids-upload-artifacts-dir "cuda${RAPIDS_CUDA_VERSION%%.*}_$(arch)"
180187
- name: Telemetry upload attributes
181188
uses: rapidsai/shared-actions/telemetry-dispatch-stash-job-artifacts@main
182189
continue-on-error: true

.github/workflows/conda-python-build.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,17 @@ jobs:
116116
ref: ${{ inputs.sha }}
117117
fetch-depth: 0
118118
- name: Standardize repository information
119+
env:
120+
RAPIDS_REPOSITORY: ${{ inputs.repo || github.repository }}
121+
RAPIDS_REF_NAME: ${{ inputs.branch || github.ref_name }}
122+
RAPIDS_NIGHTLY_DATE: ${{ inputs.date }}
119123
run: |
120-
echo "RAPIDS_REPOSITORY=${{ inputs.repo || github.repository }}" >> "${GITHUB_ENV}"
121-
echo "RAPIDS_SHA=$(git rev-parse HEAD)" >> "${GITHUB_ENV}"
122-
echo "RAPIDS_REF_NAME=${{ inputs.branch || github.ref_name }}" >> "${GITHUB_ENV}"
123-
echo "RAPIDS_NIGHTLY_DATE=${{ inputs.date }}" >> "${GITHUB_ENV}"
124+
{
125+
echo "RAPIDS_REPOSITORY=${RAPIDS_REPOSITORY}"
126+
echo "RAPIDS_SHA=$(git rev-parse HEAD)"
127+
echo "RAPIDS_REF_NAME=${RAPIDS_REF_NAME}"
128+
echo "RAPIDS_NIGHTLY_DATE=${RAPIDS_NIGHTLY_DATE}"
129+
} >> "${GITHUB_ENV}"
124130
- name: Telemetry setup
125131
uses: rapidsai/shared-actions/telemetry-dispatch-setup@main
126132
continue-on-error: true
@@ -135,7 +141,7 @@ jobs:
135141
GH_TOKEN: ${{ github.token }}
136142
- name: Get Package Name and Location
137143
if: ${{ inputs.upload-artifacts }}
138-
run: |
144+
run: |
139145
echo "RAPIDS_PACKAGE_NAME=$(RAPIDS_NO_PKG_EXTENSION=true rapids-package-name conda_python)" >> "${GITHUB_OUTPUT}"
140146
echo "CONDA_OUTPUT_DIR=${RAPIDS_CONDA_BLD_OUTPUT_DIR}" >> "${GITHUB_OUTPUT}"
141147
id: package-name
@@ -152,7 +158,7 @@ jobs:
152158
path: ${{ steps.package-name.outputs.CONDA_OUTPUT_DIR }}
153159
- name: Upload additional artifacts
154160
if: "!cancelled()"
155-
run: rapids-upload-artifacts-dir cuda${RAPIDS_CUDA_VERSION%%.*}_$(arch)_py${RAPIDS_PY_VERSION//.}
161+
run: rapids-upload-artifacts-dir "cuda${RAPIDS_CUDA_VERSION%%.*}_$(arch)_py${RAPIDS_PY_VERSION//.}"
156162
- name: Telemetry upload attributes
157163
uses: rapidsai/shared-actions/telemetry-dispatch-stash-job-artifacts@main
158164
continue-on-error: true

.github/workflows/conda-python-tests.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,17 @@ jobs:
152152
fetch-depth: 0
153153

154154
- name: Standardize repository information
155+
env:
156+
RAPIDS_REPOSITORY: ${{ inputs.repo || github.repository }}
157+
RAPIDS_REF_NAME: ${{ inputs.branch || github.ref_name }}
158+
RAPIDS_NIGHTLY_DATE: ${{ inputs.date }}
155159
run: |
156-
echo "RAPIDS_REPOSITORY=${{ inputs.repo || github.repository }}" >> "${GITHUB_ENV}"
157-
echo "RAPIDS_SHA=$(git rev-parse HEAD)" >> "${GITHUB_ENV}"
158-
echo "RAPIDS_REF_NAME=${{ inputs.branch || github.ref_name }}" >> "${GITHUB_ENV}"
159-
echo "RAPIDS_NIGHTLY_DATE=${{ inputs.date }}" >> "${GITHUB_ENV}"
160+
{
161+
echo "RAPIDS_REPOSITORY=${RAPIDS_REPOSITORY}"
162+
echo "RAPIDS_SHA=$(git rev-parse HEAD)"
163+
echo "RAPIDS_REF_NAME=${RAPIDS_REF_NAME}"
164+
echo "RAPIDS_NIGHTLY_DATE=${RAPIDS_NIGHTLY_DATE}"
165+
} >> "${GITHUB_ENV}"
160166
161167
# This has to be AFTER the checkout step. It creates a telemetry-artifacts directory,
162168
# and the checkout step would destroy it.
@@ -193,7 +199,7 @@ jobs:
193199
--handle-no-reports-found
194200
- name: Upload additional artifacts
195201
if: "!cancelled()"
196-
run: rapids-upload-artifacts-dir cuda${RAPIDS_CUDA_VERSION%%.*}_$(arch)_py${RAPIDS_PY_VERSION//.}
202+
run: rapids-upload-artifacts-dir "cuda${RAPIDS_CUDA_VERSION%%.*}_$(arch)_py${RAPIDS_PY_VERSION//.}"
197203
- name: Telemetry upload attributes
198204
uses: rapidsai/shared-actions/telemetry-dispatch-stash-job-artifacts@main
199205
continue-on-error: true

.github/workflows/conda-upload-packages.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,17 @@ jobs:
6363
fetch-depth: 0
6464

6565
- name: Standardize repository information
66+
env:
67+
RAPIDS_REPOSITORY: ${{ inputs.repo || github.repository }}
68+
RAPIDS_REF_NAME: ${{ inputs.branch || github.ref_name }}
69+
RAPIDS_NIGHTLY_DATE: ${{ inputs.date }}
6670
run: |
67-
echo "RAPIDS_REPOSITORY=${{ inputs.repo || github.repository }}" >> "${GITHUB_ENV}"
68-
echo "RAPIDS_SHA=$(git rev-parse HEAD)" >> "${GITHUB_ENV}"
69-
echo "RAPIDS_REF_NAME=${{ inputs.branch || github.ref_name }}" >> "${GITHUB_ENV}"
70-
echo "RAPIDS_NIGHTLY_DATE=${{ inputs.date }}" >> "${GITHUB_ENV}"
71+
{
72+
echo "RAPIDS_REPOSITORY=${RAPIDS_REPOSITORY}"
73+
echo "RAPIDS_SHA=$(git rev-parse HEAD)"
74+
echo "RAPIDS_REF_NAME=${RAPIDS_REF_NAME}"
75+
echo "RAPIDS_NIGHTLY_DATE=${RAPIDS_NIGHTLY_DATE}"
76+
} >> "${GITHUB_ENV}"
7177
7278
- name: Set Proper Conda Upload Token
7379
run: |

0 commit comments

Comments
 (0)