-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (79 loc) · 2.5 KB
/
workflow_call-lint.yaml
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
---
name: "Workflow call: Lint"
on:
workflow_call:
jobs:
pre-commit-check:
name: Check pre-commit rules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1
with:
extra_args: --config .pre-commit-config.yaml
lint-yaml:
name: Lint Yaml Files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: dorny/paths-filter@v3
id: filter
with:
list-files: shell
filters: |
yaml:
- added|modified: "**.yaml"
- added|modified: "**.yml"
- name: "Yamllint"
if: ${{ steps.filter.outputs.yaml == 'true' }}
uses: karancode/yamllint-github-action@master
with:
yamllint_file_or_dir: "${{ steps.filter.outputs.yaml_files }}"
yamllint_strict: false
yamllint_comment: true
yamllint_config_filepath: .ci/lint/yamllint.yaml
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
metadata-validation:
name: Validate Image Metadata
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
list-files: shell
filters: |
cue:
- added|modified: "apps/**/metadata.yaml"
- added|modified: ".ci/lint/metadata.rules.cue"
- name: Setup CUE
if: ${{ steps.filter.outputs.cue == 'true' }}
uses: cue-lang/setup-cue@a93fa358375740cd8b0078f76355512b9208acb1
- name: Validate image metadata
if: ${{ steps.filter.outputs.cue == 'true' }}
shell: bash
# Run against all files to ensure they are tested if the cue schema is changed.
run: |
find ./apps/ -name metadata.json | xargs -I {} cue vet --schema '#Spec' {} ./.ci/lint/metadata.rules.cue
renovate-config-validator:
name: Validate Renovate Config
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
list-files: shell
filters: |
renovate:
- added|modified: ".github/renovate.json5"
- name: Validate Renovate Config
if: ${{ steps.filter.outputs.renovate == 'true' }}
uses: rinchsan/renovate-config-validator@v0.2.0
with:
pattern: ".github/renovate.json5"