@@ -22,11 +22,17 @@ jobs:
2222 - name : Ensure consistent CircleCI YAML config
2323 run : cd .circleci && ./ensure-consistency.py
2424 - name : Ensure consistent GHA workflows in cancel_redundant_workflows.yml
25- run : .github/scripts/ensure_consistent_workflows.py
25+ run : |
26+ pip install ruamel.yaml==0.17.4
27+ echo "Please locally run .github/scripts/regenerate_cancel_redundant_workflow.py and commit if this step fails."
28+ .github/scripts/regenerate_cancel_redundant_workflow.py
29+ git diff --exit-code .github/workflows/cancel_redundant_workflows.yml
2630 - name : Lint native_functions.yaml
2731 run : |
2832 pip install ruamel.yaml==0.17.4
2933 .github/scripts/lint_native_functions.py
34+ - name : Extract scripts from GitHub Actions workflows
35+ run : tools/extract_scripts.py --out=.extracted_scripts
3036 - name : ShellCheck
3137 # https://github.com/koalaman/shellcheck/tree/v0.7.1#installing-a-pre-compiled-binary
3238 run : |
3642 sudo cp "shellcheck-${scversion}/shellcheck" /usr/bin/
3743 rm -r "shellcheck-${scversion}"
3844 shellcheck --version
39- EXTRACT_DIR=.shellcheck_generated
40- tools/extract_scripts.py --out=$EXTRACT_DIR
41- tools/run_shellcheck.sh .jenkins/pytorch $EXTRACT_DIR
45+ tools/run_shellcheck.sh .jenkins/pytorch .extracted_scripts
4246 - name : Ensure correct trailing newlines
4347 run : |
4448 (! git grep -Il '' -- . ':(exclude)**/contrib/**' ':(exclude)third_party' ':(exclude)**.expect' ':(exclude)tools/clang_format_hash' | tools/trailing_newlines.py || (echo "The above files do not have correct trailing newlines; please normalize them"; false))
@@ -127,12 +131,12 @@ jobs:
127131 with :
128132 fetch-depth : 2 # to allow us to use github.event.pull_request.head.sha
129133 - name : Prepare output dir with HEAD commit SHA
134+ env :
135+ HEAD_SHA : ${{ github.event.pull_request.head.sha }}
130136 run : |
131137 mkdir flake8-output
132138 cd flake8-output
133139 echo "$HEAD_SHA" > commit-sha.txt
134- env :
135- HEAD_SHA : ${{ github.event.pull_request.head.sha }}
136140 - name : Run flake8
137141 run : |
138142 set -eux
@@ -143,14 +147,14 @@ jobs:
143147 cp flake8-output.txt flake8-output/annotations.json
144148 - name : Translate annotations
145149 if : github.event_name == 'pull_request'
150+ env :
151+ HEAD_SHA : ${{ github.event.pull_request.head.sha }}
146152 run : |
147153 tools/translate_annotations.py \
148154 --file=flake8-output.txt \
149155 --regex='^(?P<filename>.*?):(?P<lineNumber>\d+):(?P<columnNumber>\d+): (?P<errorCode>\w+\d+) (?P<errorDesc>.*)' \
150156 --commit="$HEAD_SHA" \
151157 > flake8-output/annotations.json
152- env :
153- HEAD_SHA : ${{ github.event.pull_request.head.sha }}
154158 - name : Upload artifact
155159 uses : actions/upload-artifact@v2
156160 with :
@@ -175,12 +179,12 @@ jobs:
175179 with :
176180 fetch-depth : 0 # to allow tools/clang_tidy.py to do its thing
177181 - name : Prepare output dir with HEAD commit SHA
182+ env :
183+ HEAD_SHA : ${{ github.event.pull_request.head.sha }}
178184 run : |
179185 mkdir clang-tidy-output
180186 cd clang-tidy-output
181187 echo "$HEAD_SHA" > commit-sha.txt
182- env :
183- HEAD_SHA : ${{ github.event.pull_request.head.sha }}
184188 - name : Install dependencies
185189 run : |
186190 set -eux
@@ -199,6 +203,9 @@ jobs:
199203 sudo apt-get install -y clang-tidy-11
200204 sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-11 1000
201205 - name : Run clang-tidy
206+ env :
207+ BASE_SHA : ${{ github.event.pull_request.base.sha }}
208+ HEAD_SHA : ${{ github.event.pull_request.head.sha }}
202209 run : |
203210 set -eux
204211 git remote add upstream https://github.com/pytorch/pytorch
@@ -260,9 +267,6 @@ jobs:
260267 --regex='^(?P<filename>.*?):(?P<lineNumber>\d+):(?P<columnNumber>\d+): (?P<errorDesc>.*?) \[(?P<errorCode>.*)\]' \
261268 --commit="$HEAD_SHA" \
262269 > clang-tidy-output/annotations.json
263- env :
264- BASE_SHA : ${{ github.event.pull_request.base.sha }}
265- HEAD_SHA : ${{ github.event.pull_request.head.sha }}
266270 - name : Upload artifact
267271 uses : actions/upload-artifact@v2
268272 with :
0 commit comments