-
Notifications
You must be signed in to change notification settings - Fork 1.1k
107 lines (96 loc) · 2.88 KB
/
21-pr-check-format.yml
File metadata and controls
107 lines (96 loc) · 2.88 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
name: "PR: Lint"
on:
pull_request:
push:
branches:
- main
concurrency:
group: 'ci-${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
defaults:
run:
shell: sh -ex {0}
jobs:
check_format:
strategy:
fail-fast: false
matrix:
env: [ruff, mypy, pylint, black, isort]
name: Check ${{ matrix.env }}
runs-on: ubuntu-latest
env:
FORCE_COLOR: 1
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get -qy update
sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install tox
- name: Print version
run: python3 --version
- name: Test
env:
# matrix env: not to be confused w/environment variables or testenv
TOXENV: ${{ matrix.env }}
run: tox
schema-format:
strategy:
fail-fast: false
name: Check json format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Test format
run: |
tools/check_json_format.sh cloudinit/config/schemas/schema-cloud-config-v1.json
tools/check_json_format.sh cloudinit/config/schemas/schema-network-config-v1.json
tools/check_json_format.sh cloudinit/config/schemas/versions.schema.cloud-config.json
doc:
strategy:
fail-fast: false
name: Check docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install RTD Python Version
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.11.9'
- name: Install dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get -qy update
sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install tox
- name: Spellcheck
run: |
tox
env:
TOXENV: doc-spelling
- name: Build docs
env:
TOXENV: doc
run: |
tox
shell-lint:
name: Shell Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install ShellCheck
run: |
sudo apt-get update
sudo apt install shellcheck
- name: Run ShellCheck
run: |
shellcheck --color=always ./tools/ds-identify
workflow-lint:
name: GitHub Action and Workflow Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: reviewdog/action-actionlint@83e4ed25b168066ad8f62f5afbb29ebd8641d982 # v1.69.1
with:
fail_level: any