forked from pytorch/executorch
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (80 loc) · 3.14 KB
/
_link_check.yml
File metadata and controls
83 lines (80 loc) · 3.14 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
on:
workflow_call:
inputs:
ref:
type: string
required: true
jobs:
lint-urls:
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'skip-url-lint') }}
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
with:
runner: linux.2xlarge
docker-image: ci-image:executorch-ubuntu-22.04-linter
submodules: false
fetch-depth: 0
ref: ${{ inputs.ref }}
timeout: 120
script: |
./scripts/lint_urls.sh $(
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}"
else
echo "${{ github.event.before }}" "${{ github.sha }}"
fi
) || {
echo
echo "URL lint failed."
echo "If this is a transient outage, you can bypass it by adding the \`skip-url-lint\` label to your PR."
echo "Or add \`@lint-ignore\` somewhere on the same line as the URL you want to skip checking."
exit 1
}
lint-xrefs:
if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'skip-xref-lint') }}
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
with:
runner: linux.2xlarge
docker-image: ci-image:executorch-ubuntu-22.04-linter
submodules: false
fetch-depth: 0
ref: ${{ inputs.ref }}
timeout: 60
script: |
./scripts/lint_xrefs.sh $(
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}"
else
echo "${{ github.event.before }}" "${{ github.sha }}"
fi
) || {
echo
echo "Xref lint failed."
echo "If this is a transient outage, you can bypass it by adding the \`skip-xref-lint\` label to your PR."
echo "Or add \`@lint-ignore\` somewhere on the same line as the reference you want to skip checking."
exit 1
}
lint-file-size:
if: ${{ github.event_name == 'pull_request' }}
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
with:
runner: linux.2xlarge
docker-image: ci-image:executorch-ubuntu-22.04-linter
submodules: false
fetch-depth: 0
ref: ${{ inputs.ref }}
timeout: 30
script: |
chmod +x ./scripts/lint_file_size.sh
./scripts/lint_file_size.sh $(
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}"
else
echo "${{ github.event.before }}" "${{ github.sha }}"
fi
) || {
echo
echo "File size lint failed: some files exceed the 1 MB limit."
echo "If you really need large files, consider using Git LFS or storing them elsewhere."
echo "If you really need to get unblocked and check in the file, can add it to the EXCEPTIONS list in scripts/lint_file_size.sh."
exit 1
}