-
Notifications
You must be signed in to change notification settings - Fork 25
155 lines (152 loc) · 5.81 KB
/
checks.yaml
File metadata and controls
155 lines (152 loc) · 5.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
on:
workflow_call:
inputs:
dependency_generator_config_file_path:
description: "Location of the dependencies.yaml configuration file"
default: "dependencies.yaml"
required: false
type: string
enable_check_size:
description: "Whether to enable the size checker"
default: true
type: boolean
required: false
enable_check_style:
description: "Whether to enable the style checker"
default: true
type: boolean
required: false
enable_check_generated_files:
description: "Whether to enable the generated files checker"
default: true
type: boolean
required: false
enable_check_pr_job_dependencies:
description: "Whether to enable the PR workflow dependency checker"
default: true
type: boolean
required: false
enable_check_version_files_changed:
description: "Whether to enable the version file changed checker"
default: true
type: boolean
required: false
enable_check_version_against_tag:
description: "Whether to enable the version tag checker"
default: true
type: boolean
required: false
ignored_pr_jobs:
description: "Space separated list of jobs to ignore when checking PR workflow dependencies"
default: ""
type: string
required: false
defaults:
run:
shell: bash
jobs:
other-checks:
runs-on: ubuntu-latest
container:
image: rapidsai/ci-conda:26.08-latest # zizmor: ignore[unpinned-images]
env:
RAPIDS_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: true
- name: Telemetry setup
uses: rapidsai/shared-actions/telemetry-dispatch-setup@main
continue-on-error: true
if: ${{ vars.TELEMETRY_ENABLED == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
- name: Get PR Info
id: get-pr-info
uses: nv-gha-runners/get-pr-info@main
- name: Run rapids-size-checker
if: ${{ inputs.enable_check_size }}
run: rapids-size-checker
env:
RAPIDS_BASE_BRANCH: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.ref }}
- name: Check workflow file dependencies
if: ${{ inputs.enable_check_pr_job_dependencies }}
run: rapids-check-pr-job-dependencies "${IGNORED_JOBS}"
env:
IGNORED_JOBS: ${{ inputs.ignored_pr_jobs }}
- name: Check changed files
id: changed-files
if: ${{ inputs.enable_check_version_files_changed }}
uses: rapidsai/shared-actions/changed-files@main
with:
files_yaml: |
version_files:
- VERSION
- RAPIDS_VERSION
- name: Check if VERSION or RAPIDS_VERSION file has changed
if: ${{ inputs.enable_check_version_files_changed }}
run: |
if [ "$VERSION_FILES_CHANGED" != "false" ]; then
echo "ERROR: VERSION or RAPIDS_VERSION file has been changed"
exit 1
fi
env:
VERSION_FILES_CHANGED: ${{ (inputs.enable_check_version_files_changed && fromJSON(steps.changed-files.outputs.changed_file_groups).version_files) || 'false' }}
- name: Fetch tags
if: ${{ inputs.enable_check_version_against_tag }}
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
fetch-depth: 0 # https://github.com/actions/checkout/issues/1471
fetch-tags: true
- name: Check VERSION file against latest tag
if: ${{ inputs.enable_check_version_against_tag }}
run: |
expected_version="$(cat VERSION)"
actual_version="$(python -m dunamai from git --format '{base}')"
if [ "$expected_version" != "$actual_version" ]; then
echo "ERROR: Expected latest tag to be '$expected_version', got '$actual_version'; did you accidentally merge 'main' into a release-bound PR?"
exit 1
fi
- name: Telemetry upload attributes
uses: rapidsai/shared-actions/telemetry-dispatch-stash-job-artifacts@main
continue-on-error: true
if: ${{ vars.TELEMETRY_ENABLED == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
check-style:
if: ${{ inputs.enable_check_style }}
runs-on: ubuntu-latest
container:
# Must pin to Python <3.13, cmake-format is broken, see https://github.com/python/cpython/issues/140797
image: rapidsai/ci-conda:26.08-cuda13.2.0-ubuntu24.04-py3.12 # zizmor: ignore[unpinned-images]
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: true
- name: Telemetry setup
uses: rapidsai/shared-actions/telemetry-dispatch-setup@main
continue-on-error: true
if: ${{ vars.TELEMETRY_ENABLED == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
- name: Get PR Info
id: get-pr-info
uses: nv-gha-runners/get-pr-info@main
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
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
env:
RAPIDS_BASE_BRANCH: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.ref }}
- name: Telemetry upload attributes
uses: rapidsai/shared-actions/telemetry-dispatch-stash-job-artifacts@main
continue-on-error: true
if: ${{ vars.TELEMETRY_ENABLED == 'true' }}
env:
GH_TOKEN: ${{ github.token }}