-
Notifications
You must be signed in to change notification settings - Fork 237
161 lines (132 loc) · 5.18 KB
/
ci-markdown-checks.yml
File metadata and controls
161 lines (132 loc) · 5.18 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
156
157
158
159
160
161
name: File Checks
on:
pull_request:
merge_group:
permissions:
contents: read
pull-requests: write # required for posting PR review comments
jobs:
markdown-lint-check:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
name: Markdown Lint Check
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# equivalent cli: markdownlint-cli2 "**/*.md" "!**/CHANGELOG.md" --config .markdownlint-cli2.yaml
- name: "Markdown Lint Check"
uses: DavidAnson/markdownlint-cli2-action@07035fd053f7be764496c0f8d8f9f41f98305101 # v22.0.0
with:
config: .markdownlint-cli2.yaml
fix: false
globs: |
**/*.md
markdown-link-check:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
name: Markdown Link Check
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# equivalent cli: linkspector check
- name: Run linkspector
uses: umbrelladocs/action-linkspector@652f85bc57bb1e7d4327260decc10aa68f7694c3 # v1.4.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-annotations
fail_on_error: true
json-lint-check:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
name: JSON Lint Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
cache: "npm"
node-version: "24"
- name: install dependencies
run: npm ci --ignore-scripts
# equivalent cli: jsonlint --config ./.jsonlintrc.yml
- name: "JSON Lint Check"
run: npm run check:lint:json
renovate-config-check:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
name: Renovate Config Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
cache: "npm"
node-version: "24"
- name: install dependencies
run: npm ci --ignore-scripts
# equivalent cli: renovate-config-validator
- name: "Renovate Lint Check"
run: npm run check:lint:renovate
ruby-check:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
name: RuboCop Check
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
cache: "npm"
node-version: "24"
- name: Install Ruby
uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0
with:
ruby-version: "3.2"
- name: Install Tools
run: npm ci --ignore-scripts && bundle install
- name: "Lint all ruby files"
run: |
set -e # forces exit code to propagate
npm run check:lint:ruby -- --format github
- name: "Check all ruby source files"
run: |
set -e # forces exit code to propagate
npm run check:source:ruby -- --format github
yaml-lint-check:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
name: YAML Lint Check
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# equivalent cli: yamllint .
- name: "YAML Lint Check"
uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c #v3.1.1
with:
config_file: .yamllint
spelling-check:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
name: Spelling Check
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: streetsidesoftware/cspell-action@9cd41bb518a24fefdafd9880cbab8f0ceba04d28 # v8.3.0
with:
use_cspell_files: true
config: .cspell.yml
suggestions: true
treat_flagged_words_as_errors: true
format-check:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby-contrib' }}
name: File Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
cache: "npm"
node-version: "24"
- name: Install Ruby
uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0
with:
ruby-version: "3.2"
- name: Install Tools
run: npm ci --ignore-scripts && bundle install
- name: "Format all document Check"
run: npm run write:format
- name: validate files
run: git diff --exit-code ':*.*' || (echo 'Files are out of date, please run "npm run write:format" and commit the changes in this PR.' && exit 1)