Skip to content

Commit

Permalink
chore: yaml reformatting (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Jul 31, 2024
1 parent 8de1737 commit b89fb7b
Show file tree
Hide file tree
Showing 24 changed files with 100 additions and 69 deletions.
3 changes: 3 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
exclude_paths:
- mkdocs.yml
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
labels:
- "skip-changelog"
- skip-changelog
69 changes: 34 additions & 35 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,68 @@
---
# Format and labels used by Ansible DevTools projects
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
name-template: v$RESOLVED_VERSION
tag-template: v$RESOLVED_VERSION
# Use '-' instead of '*' for unordered list to match prettier behavior
change-template: "- $TITLE (#$NUMBER) @$AUTHOR"
categories:
- title: "Enhancements"
- title: Enhancements
labels:
- "major" # c6476b
- "minor"
- "feature" # 006b75
- "enhancement" # ededed
- "refactoring"
- title: "Bugfixes"
- major # c6476b
- minor
- feature # 006b75
- enhancement # ededed
- refactoring
- title: Bugfixes
labels:
- "bug" # fbca04
- title: Other
- "patch"
- "deprecated" # fef2c0
- bug # fbca04
- title: Other - "patch" - "deprecated" # fef2c0
exclude-labels:
- "bot:chronographer:skip"
- "skip-changelog"
- bot:chronographer:skip
- skip-changelog
replacers:
# https://github.com/release-drafter/release-drafter/issues/569#issuecomment-645942909
- search: '/(?:and )?@(pre-commit-ci|dependabot)(?:\[bot\])?,?/g'
- search: /(?:and )?@(pre-commit-ci|dependabot)(?:\[bot\])?,?/g
replace: ""
version-resolver:
# major:
# labels:
minor:
labels:
- "major"
- "minor"
- "feature"
- "enhancement"
- "refactoring"
- major
- minor
- feature
- enhancement
- refactoring
patch:
labels:
- "patch"
- "bug"
- "deprecated"
- patch
- bug
- deprecated
default: patch
exclude-contributors:
- "dependabot"
- "pre-commit-ci"
- dependabot
- pre-commit-ci
autolabeler:
- label: "skip-changelog"
- label: skip-changelog
title:
- "/pre-commit autoupdate/"
- /pre-commit autoupdate/
body:
- "/type: chore/i"
branch:
- "/^chore/i"
- label: "bug"
- /^chore/i
- label: bug
branch:
- "/^fix/i"
- /^fix/i
body:
- "/type: fix/i"
- label: "feature"
- label: feature
title:
- "/^(feat|feature)/i"
- /^(feat|feature)/i
body:
- "/type: feature/i"
- label: "deprecated"
- label: deprecated
title:
- "/^deprecat(ed|ion)/i"
- /^deprecat(ed|ion)/i
body:
- "/type: deprecat(ed|ion)/i"
template: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ack.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# ack workflow runs on any change made to a pull-request and aims to verify
# that is following our practices. Initial version is checking correct label
# presence.
Expand All @@ -13,7 +14,7 @@ on:
required: false
jobs:
ack:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
environment: ack
env:
BOT_PAT: ${{ secrets.BOT_PAT }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# push workflow is shared and expected to perform actions after a merge happens
# on a maintenance branch (default or release). For example updating the
# draft release-notes.
Expand All @@ -8,13 +9,13 @@ on:
# branches to consider in the event; optional, defaults to all
branches:
- main
- "releases/**"
- "stable/**"
- releases/**
- stable/**
workflow_call: # allows reuse of this workflow from other devtools repos

jobs:
update_release_draft:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
env:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/push_network.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# push workflow is shared and expected to perform actions after a merge happens
# on a maintenance branch (default or release). For example updating the
# draft release-notes.
Expand All @@ -20,7 +21,7 @@ on:

jobs:
update_release_draft:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
environment: push
steps:
- uses: actions/checkout@v4
Expand All @@ -32,7 +33,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install antsibull-changelog, antsichaut
run: >
Expand All @@ -58,9 +59,9 @@ jobs:

- name: Get previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@master"
uses: WyriHaximus/github-action-get-previous-tag@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

## this part is commented out to check push workflow
## ref - https://github.com/ansible-collections/cisco.nxos/pull/765
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# It is not currently possible to use trusted publishing with a shared workflow
# https://github.com/pypi/warehouse/blob/main/docs/user/trusted-publishers/troubleshooting.md#reusable-workflows-on-github
# this file is for reference only now
Expand All @@ -6,12 +7,11 @@ name: release

on:
workflow_call:

jobs:
release:
name: release ${{ github.event.ref }}
environment: release
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
id-token: write

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_ah.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: "Build the collection"
- name: Build the collection
run: |
ansible-galaxy collection build -v --force
- name: "Publish the collection on Automation Hub"
- name: Publish the collection on Automation Hub
if: ${{ inputs.ah_publish }}
run: |
[[ "${{ secrets.ah_token != '' }}" ]] || { echo "ah_token is required to publish on automation hub" ; exit 1; }
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: "Build the collection"
- name: Build the collection
run: |
ansible-galaxy collection build -v --force
- name: "Publish the collection on Galaxy"
- name: Publish the collection on Galaxy
if: ${{ inputs.galaxy_publish }}
run: |
[[ "${{ secrets.ansible_galaxy_api_key != '' }}" ]] || { echo "ansible_galaxy_api_key is required to publish on galaxy" ; exit 1; }
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---
name: test
on:
pull_request:
jobs:
pre:
name: pre
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }}
steps:
- name: Determine matrix
id: generate_matrix
uses: coactions/dynamic-matrix@v1
with:
min_python: "3.11"
max_python: "3.11"
min_python: "3.12"
max_python: "3.12"
default_python: "3.12"
other_names: |
lint
docs
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ env:
jobs:
prepare:
name: prepare
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }}
steps:
Expand All @@ -58,7 +58,7 @@ jobs:

test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
runs-on: ${{ matrix.os || 'ubuntu-24.04' }}
needs:
- prepare
defaults:
Expand All @@ -82,12 +82,12 @@ jobs:
~/.cache/pre-commit
key: pre-commit-${{ matrix.name || matrix.passed_name }}-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Set up Python ${{ matrix.python_version || '3.10' }}
- name: Set up Python ${{ matrix.python_version || '3.12' }}
if: "!contains(matrix.shell, 'wsl')"
uses: actions/setup-python@v5
with:
cache: pip
python-version: ${{ matrix.python_version || '3.10' }}
python-version: ${{ matrix.python_version || '3.12' }}

- name: Install tox
run: |
Expand Down Expand Up @@ -121,8 +121,7 @@ jobs:
printf '### Failed as git reported modified and/or untracked files\n```\n%s\n```\n' "$(git status -s)" | tee -a "$GITHUB_STEP_SUMMARY"
exit 99
fi
# https://github.com/actions/toolkit/issues/193

# https://github.com/actions/toolkit/issues/193
check:
if: always()
permissions:
Expand All @@ -132,7 +131,7 @@ jobs:

needs:
- test
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ repos:
files: \.(yaml|yml)$
types: [file, yaml]
entry: yamllint --strict
- repo: https://github.com/ansible/ansible-lint
rev: v24.7.0
hooks:
- id: ansible-lint
language_version: "3.12"
args: [--fix]
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ mkdocs:
configuration: mkdocs.yml

build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.11"
python: "3.12"
commands:
- pip install --user tox
- python3 -m tox -e docs
Expand Down
6 changes: 6 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
extends: default
rules:
braces:
max-spaces-inside: 1
comments:
# prettier compatibility
min-spaces-from-content: 1
Expand All @@ -10,6 +13,9 @@ rules:
document-start: disable
# we need to decide if we want to impose one or not
line-length: disable
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true
truthy:
# "on:" is perfectly valid key on github actions:
check-keys: false
1 change: 1 addition & 0 deletions config/devtools.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# This file documents repositories that are nurtured by Ansible DevTools team.
# Not all these repos are fully managed or maintained by the team.
# We aim to use this file when performing maintenance and audit.
Expand Down
1 change: 1 addition & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dictionaryDefinitions:
- name: words
path: .config/dictionary.txt
Expand Down
5 changes: 3 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
site_name: Ansible DevTools
site_url: https://ansible.readthedocs.io/projects/team-devtools/
repo_url: https://github.com/ansible/team-devtools
Expand Down Expand Up @@ -34,8 +35,8 @@ nav:
- Release: guides/vscode/release.md
- stats:
- Molecule Plugins: stats/molecule-plugins.md
# - ansible-language-server: '!import https://github.com/ansible/ansible-language-server?branch=main&multi_docs=False'
# - projects: "*include .cache/*/mkdocs.yml"
# - ansible-language-server: '!import https://github.com/ansible/ansible-language-server?branch=main&multi_docs=False'
# - projects: "*include .cache/*/mkdocs.yml"
plugins:
- autorefs
- material/search
Expand Down
4 changes: 3 additions & 1 deletion playbooks/deploy-bot-pat.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: Deploy BOT_PAT secret
hosts: localhost
gather_facts: false
Expand All @@ -7,7 +8,8 @@
file: ../config/devtools.yml
name: devtools

- debug:
- name: Display info
ansible.builtin.debug:
msg: "{{ item }}"
loop: "{{ env_secrets | dict2items(key_name='env_name', value_name='env_secrets') }}"

Expand Down
Loading

0 comments on commit b89fb7b

Please sign in to comment.