-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.26 KB
/
Copy pathlint-test.yml
File metadata and controls
47 lines (40 loc) · 1.26 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
name: Lint and Test
# This workflow runs linting and tests on PRs and pushes to main
# It ensures code quality and prevents broken code from being merged
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch: {}
jobs:
lint-yaml:
name: Lint YAML Files
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
continue-on-error: false
- name: Install yamllint
run: |
python -m pip install --upgrade pip
pip install yamllint
continue-on-error: false
- name: Run yamllint
run: |
echo "Running yamllint on workflow files..."
yamllint -d \
'{extends: default, rules: {line-length: {max: 120}, comments: {min-spaces-from-content: 1}}}' .github/workflows/ \
|| true
continue-on-error: false
- name: Validate action.yml
run: |
echo "Validating action.yml syntax..."
python -c "import yaml; yaml.safe_load(open('action.yml'))" && echo "✓ action.yml is valid YAML"
continue-on-error: false