Skip to content

Commit cb29b15

Browse files
committed
Use nox for running yamllint.
1 parent 866fcf7 commit cb29b15

File tree

4 files changed

+61
-33
lines changed

4 files changed

+61
-33
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/nox.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
3+
# SPDX-License-Identifier: GPL-3.0-or-later
4+
# SPDX-FileCopyrightText: 2023 Maxwell G <[email protected]
5+
6+
name: nox
7+
'on':
8+
push:
9+
branches: [main]
10+
pull_request:
11+
branches: [main]
12+
# Run once per week (Thursday at 04:00 UTC)
13+
schedule:
14+
- cron: '0 4 * * 4'
15+
workflow_dispatch:
16+
17+
env:
18+
FORCE_COLOR: "1"
19+
20+
jobs:
21+
nox:
22+
runs-on: ubuntu-latest
23+
defaults:
24+
run:
25+
working-directory: antsibull
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
include:
30+
- session: lint
31+
python-versions: "3.12"
32+
name: "Run nox ${{ matrix.session }} session"
33+
steps:
34+
- name: Check out antsibull
35+
uses: actions/checkout@v4
36+
with:
37+
path: antsibull
38+
- name: Setup nox
39+
uses: wntrblm/[email protected]
40+
with:
41+
python-versions: "${{ matrix.python-versions }}"
42+
- name: Set up nox environments
43+
run: |
44+
OTHER_ANTSIBULL_MODE=git nox -v -e "${{ matrix.session }}" ${{ matrix.codecov && 'coverage' || '' }} --install-only
45+
- name: "Run nox -e ${{ matrix.session }}"
46+
run: |
47+
OTHER_ANTSIBULL_MODE=git nox -v -e "${{ matrix.session }}" --reuse-existing-virtualenvs --no-install

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ In case of a potential release blocker, the following actions need to be done:
7777
release of Ansible. This file will be created by the `antsibull-build single`
7878
command.
7979

80+
## Linting
81+
82+
To lint the files in this repository, run `nox -e lint`. This assumes you have `nox` installed.
83+
8084
## Adding a new collection
8185

8286
### Next Ansible major release

noxfile.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
# SPDX-FileCopyrightText: 2023 Maxwell G <[email protected]
4+
15
from __future__ import annotations
26

37
import nox
@@ -7,3 +11,9 @@
711
def mkdocs(session: nox.Session):
812
session.install("-r", "docs-requirements.txt")
913
session.run("mkdocs", *(session.posargs or ["build"]))
14+
15+
16+
@nox.session
17+
def lint(session: nox.Session):
18+
session.install("yamllint")
19+
session.run("yamllint", ".")

0 commit comments

Comments
 (0)