Skip to content

Commit

Permalink
🧪 Integrate yamllint
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Jan 3, 2024
1 parent ed69c08 commit b8fa491
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 79 deletions.
15 changes: 5 additions & 10 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
---

# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github:
- asvetlov
- webknjaz
# patreon: # Replace with a single Patreon username
# open_collective: # Replace with a single Open Collective username
# ko_fi: # Replace with a single Ko-fi username
# tidelift: pypi/multidict # A single Tidelift platform-name/package-name e.g., npm/babel
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
# liberapay: # Replace with a single Liberapay username
# issuehunt: # Replace with a single IssueHunt username
# otechie: # Replace with a single Otechie username
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

...
4 changes: 4 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

rtd:
project: multidict

Expand All @@ -6,3 +8,5 @@ chronographer:
exclude:
bots:
- dependabot-preview

...
36 changes: 20 additions & 16 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
---

version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
labels:
- dependencies
- autosquash
schedule:
interval: "daily"
# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: /
labels:
- dependencies
- autosquash
schedule:
interval: daily

# Maintain dependencies for Python
- package-ecosystem: pip
directory: /
labels:
- dependencies
- autosquash
schedule:
interval: daily

# Maintain dependencies for Python
- package-ecosystem: "pip"
directory: "/"
labels:
- dependencies
- autosquash
schedule:
interval: "daily"
...
24 changes: 14 additions & 10 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

name: Dependabot auto-merge
on: pull_request_target

Expand All @@ -11,13 +13,15 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.6.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.6.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

...
66 changes: 44 additions & 22 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
---

name: CI/CD

on:
merge_group:
push:
branches:
- master
- '[0-9].[0-9]+' # matches to backport branches, e.g. 3.6
tags: [ 'v*' ]
- master
- >-
[0-9].[0-9]+
tags:
- v*
pull_request:
branches:
- master
- '[0-9].[0-9]+' # matches to backport branches, e.g. 3.6
- master
- >-
[0-9].[0-9]+
schedule:
- cron: '0 6 * * *' # Daily 6AM UTC build
- cron: 0 6 * * * # Daily 6AM UTC build


env:
Expand Down Expand Up @@ -124,14 +129,14 @@ jobs:
no-extensions: ['', 'Y']
os: [ubuntu, macos, windows]
exclude:
- os: macos
no-extensions: 'Y'
- os: windows
no-extensions: 'Y'
- os: macos
no-extensions: Y
- os: windows
no-extensions: Y
include:
- pyver: pypy-3.8
no-extensions: 'Y'
os: ubuntu
- pyver: pypy-3.8
no-extensions: Y
os: ubuntu
fail-fast: false
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 15
Expand All @@ -154,10 +159,25 @@ jobs:
- name: Cache PyPI
uses: actions/cache@v3
with:
key: pip-ci-${{ runner.os }}-${{ matrix.pyver }}-{{ matrix.no-extensions }}-${{ hashFiles('requirements/*.txt') }}
key: >-
pip-ci-${{
runner.os
}}-${{
matrix.pyver
}}-{{
matrix.no-extensions
}}-${{
hashFiles('requirements/*.txt')
}}
path: ${{ steps.pip-cache.outputs.dir }}
restore-keys: |
pip-ci-${{ runner.os }}-${{ matrix.pyver }}-{{ matrix.no-extensions }}-
restore-keys: >-
pip-ci-${{
runner.os
}}-${{
matrix.pyver
}}-{{
matrix.no-extensions
}}-
- name: Install dependencies
uses: py-actions/py-dependency-install@v4
with:
Expand All @@ -168,8 +188,8 @@ jobs:
run: |
python -m pytest tests -vv
- name: Prepare coverage artifact
# combining Linux and Windows paths is tricky, left this exercise for others
# multidict has no Winows or MacOS specific code paths anyway
# combining Linux and Windows paths is tricky, left this exercise for
# others multidict has no Windows or macOS specific code paths anyway
if: ${{ matrix.os == 'ubuntu' }}
uses: aio-libs/prepare-coverage@v22.1.2

Expand All @@ -195,9 +215,9 @@ jobs:
# Run only on pushing a tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Dummy
run: |
echo "Predeploy step"
- name: Dummy
run: |
echo "Predeploy step"
build-wheels:
name: Build wheels on ${{ matrix.os }} ${{ matrix.qemu }}
Expand All @@ -210,7 +230,7 @@ jobs:
os: [ubuntu, windows, macos]
qemu: ['']
include:
# Split ubuntu job for the sake of speed-up
# Split ubuntu job for the sake of speed-up
- os: ubuntu
qemu: aarch64
- os: ubuntu
Expand Down Expand Up @@ -287,3 +307,5 @@ jobs:
# dist/ contains the built packages, which smoketest-artifacts/
# contains the signatures and certificates.
files: dist/**

...
49 changes: 28 additions & 21 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: "CodeQL"
---

name: CodeQL

on:
push:
branches: [ "master" ]
branches:
- master
pull_request:
branches: [ "master" ]
branches:
- master
schedule:
- cron: "35 8 * * 4"
- cron: 35 8 * * 4

jobs:
analyze:
Expand All @@ -21,22 +25,25 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ python ]
language:
- python

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
- name: Checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: /language:${{ matrix.language }}

...
3 changes: 3 additions & 0 deletions .github/workflows/reusable-linters.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---

name: Linters

on:
Expand Down Expand Up @@ -71,3 +73,4 @@ jobs:
run: |
twine check --strict dist/*
...
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ repos:
- yaml
- id: check-readthedocs

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.33.0
hooks:
- id: yamllint
args:
- --strict

- repo: local
hooks:
- id: changelogs-rst
Expand Down
18 changes: 18 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---

extends: default

rules:
indentation:
level: error
indent-sequences: false
truthy:
allowed-values:
- >-
false
- >-
true
- >- # Allow "on" key name in GHA CI/CD workflow definitions
on

...

0 comments on commit b8fa491

Please sign in to comment.