Skip to content

Commit 798cadd

Browse files
committed
Add yamllint CI
1 parent 261d920 commit 798cadd

2 files changed

Lines changed: 46 additions & 19 deletions

File tree

.github/workflows/yamllint.yml

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,58 @@
11
name: yamllint
22

3-
"on":
3+
on:
44
pull_request:
55
types:
66
- opened
77
- synchronize
8+
- reopened
9+
paths:
10+
- '**/*.yml'
11+
- '**/*.yaml'
12+
- '.yamllint'
13+
14+
permissions:
15+
contents: read
16+
17+
# This will only allow a single markdownlint action to run per PR.
18+
# Any github action running on the older commits will be aborted.
19+
concurrency:
20+
group: yamllint-${{ github.workflow }}-${{ github.event.pull_request.number }}
21+
cancel-in-progress: true
822

923
jobs:
1024
yamllint:
1125
runs-on: ubuntu-latest
1226

1327
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v2
16-
17-
- name: Setup Python3 and Pip3
18-
run: |
19-
apt-get update
20-
apt-get install python3 python3-pip -y
21-
python3 --version
22-
pip3 --version
23-
24-
- name: Install yamllint
25-
run: python3 -m pip install yamllint
26-
27-
- name: Run yamllint
28-
if: ${{ github.event_name == 'pull_request' }}
29-
run: |
30-
yamllint --strict --config-file .yamllint .
28+
- name: Checkout code
29+
uses: actions/checkout@v7
30+
with:
31+
fetch-depth: 1
32+
# Sparse checkout will only pull the specified files instead of the entire repo
33+
# This saves around 4s per run.
34+
# Sparse checkout sometimes pulls all files
35+
# https://github.com/actions/checkout/issues/1550
36+
37+
# Add a new step to test sparse-checkout if it fails as mentioned in the above issue
38+
# - name: Temp
39+
# working-directory: .
40+
# run: ls -la .server
41+
# shell: bash
42+
43+
sparse-checkout: |
44+
'**/*.yml'
45+
'**/*.yaml'
46+
.yamllint
47+
sparse-checkout-cone-mode: false
48+
49+
- name: Setup Python
50+
uses: actions/setup-python@v5
51+
with:
52+
python-version: '3.13'
53+
54+
- name: Install yamllint
55+
run: pip install --disable-pip-version-check yamllint==1.38.0
56+
57+
- name: Run yamllint
58+
run: yamllint --strict --config-file .yamllint .

.yamllint

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
extends: default
32

43
ignore: |-2

0 commit comments

Comments
 (0)