Skip to content

Commit

Permalink
Use nox for running yamllint.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Apr 28, 2024
1 parent 6be128d commit 801e987
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 33 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/lint.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/nox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2023 Maxwell G <maxwell@gtmx.me

name: nox
'on':
push:
branches: [main]
pull_request:
branches: [main]
# Run once per week (Thursday at 04:00 UTC)
schedule:
- cron: '0 4 * * 4'
workflow_dispatch:

env:
FORCE_COLOR: "1"

jobs:
nox:
runs-on: ubuntu-latest
defaults:
run:
working-directory: antsibull
strategy:
fail-fast: false
matrix:
include:
- session: lint
python-versions: "3.12"
name: "Run nox ${{ matrix.session }} session"
steps:
- name: Check out antsibull
uses: actions/checkout@v4
with:
path: antsibull
- name: Setup nox
uses: wntrblm/nox@2024.04.15
with:
python-versions: "${{ matrix.python-versions }}"
- name: Set up nox environments
run: |
OTHER_ANTSIBULL_MODE=git nox -v -e "${{ matrix.session }}" ${{ matrix.codecov && 'coverage' || '' }} --install-only
- name: "Run nox -e ${{ matrix.session }}"
run: |
OTHER_ANTSIBULL_MODE=git nox -v -e "${{ matrix.session }}" --reuse-existing-virtualenvs --no-install
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ In case of a potential release blocker, the following actions need to be done:
release of Ansible. This file will be created by the `antsibull-build single`
command.

## Linting

To lint the files in this repository, run `nox -e lint`. This assumes you have `nox` installed.

## Adding a new collection

### Next Ansible major release
Expand Down
10 changes: 10 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2023 Maxwell G <maxwell@gtmx.me

from __future__ import annotations

import nox
Expand All @@ -7,3 +11,9 @@
def mkdocs(session: nox.Session):
session.install("-r", "docs-requirements.txt")
session.run("mkdocs", *(session.posargs or ["build"]))


@nox.session
def lint(session: nox.Session):
install(session, "yamllint")
session.run("yamllint", ".")

0 comments on commit 801e987

Please sign in to comment.