Skip to content

Commit 2eb12a7

Browse files
authored
Setup GitHub Workflows linter and yaml-reformatter (#253)
1 parent d28b826 commit 2eb12a7

File tree

3 files changed

+137
-109
lines changed

3 files changed

+137
-109
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
---
12
version: 2
23
updates:
3-
- package-ecosystem: pip
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
open-pull-requests-limit: 10
8-
target-branch: master
9-
- package-ecosystem: github-actions
10-
directory: /
11-
schedule:
12-
interval: daily
13-
open-pull-requests-limit: 10
4+
- package-ecosystem: pip
5+
directory: /
6+
schedule:
7+
interval: daily
8+
open-pull-requests-limit: 10
9+
target-branch: master
10+
- package-ecosystem: github-actions
11+
directory: /
12+
schedule:
13+
interval: daily
14+
open-pull-requests-limit: 10

.github/workflows/main.yml

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,72 @@
22
name: CI
33

44
on:
5-
push:
6-
branches: ["master"]
7-
pull_request:
8-
branches: ["master"]
9-
workflow_dispatch:
5+
push:
6+
branches: [master]
7+
pull_request:
8+
branches: [master]
9+
workflow_dispatch:
1010

1111
jobs:
12-
test:
13-
name: "Python ${{ matrix.python-version }}"
14-
runs-on: "ubuntu-latest"
15-
env:
16-
USING_COVERAGE: "3.7,3.8,3.9,3.10"
12+
test:
13+
name: Python ${{ matrix.python-version }}
14+
runs-on: ubuntu-latest
15+
env:
16+
USING_COVERAGE: 3.7,3.8,3.9,3.10
1717

18-
strategy:
19-
matrix:
20-
python-version: ["3.7", "3.8", "3.9", "3.10"]
18+
strategy:
19+
matrix:
20+
python-version: ['3.7', '3.8', '3.9', '3.10']
2121

22-
steps:
23-
- uses: "actions/checkout@v2"
24-
- uses: "actions/setup-python@v2"
25-
with:
26-
python-version: "${{ matrix.python-version }}"
27-
- name: "Install dependencies"
28-
run: |
29-
set -xe
30-
python -VV
31-
python -m site
32-
python -m pip install --upgrade pip
33-
python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions
34-
- name: "Run tox targets for ${{ matrix.python-version }}"
35-
run: "python -m tox"
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
set -xe
30+
python -VV
31+
python -m site
32+
python -m pip install --upgrade pip
33+
python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions
34+
- name: Run tox targets for ${{ matrix.python-version }}
35+
run: python -m tox
3636

37-
- name: Prepare coverage artifact
38-
if: ${{ contains(env.USING_COVERAGE, matrix.python-version) }}
39-
uses: aio-libs/[email protected]
37+
- name: Prepare coverage artifact
38+
if: ${{ contains(env.USING_COVERAGE, matrix.python-version) }}
39+
uses: aio-libs/[email protected]
4040

41-
check:
42-
name: Check
43-
if: always()
44-
needs: [test]
45-
runs-on: ubuntu-latest
46-
steps:
47-
- name: Decide whether the needed jobs succeeded or failed
48-
uses: re-actors/alls-green@release/v1
49-
with:
50-
jobs: ${{ toJSON(needs) }}
51-
- name: Upload coverage
52-
uses: aio-libs/[email protected]
41+
check:
42+
name: Check
43+
if: always()
44+
needs: [test]
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Decide whether the needed jobs succeeded or failed
48+
uses: re-actors/alls-green@release/v1
49+
with:
50+
jobs: ${{ toJSON(needs) }}
51+
- name: Upload coverage
52+
uses: aio-libs/[email protected]
5353

54-
package:
55-
name: "Build & verify package"
56-
runs-on: "ubuntu-latest"
54+
package:
55+
name: Build & verify package
56+
runs-on: ubuntu-latest
5757

58-
steps:
59-
- uses: "actions/checkout@v2"
60-
- uses: "actions/setup-python@v2"
61-
with:
62-
python-version: "3.9"
58+
steps:
59+
- uses: actions/checkout@v2
60+
- uses: actions/setup-python@v2
61+
with:
62+
python-version: '3.9'
6363

64-
- name: "Install poetry, check-wheel-content, and twine"
65-
run: "python -m pip install build check-wheel-contents twine"
66-
- name: "Build package"
67-
run: "python -m build"
68-
- name: "List result"
69-
run: "ls -l dist"
70-
- name: "Check wheel contents"
71-
run: "check-wheel-contents dist/*.whl"
72-
- name: "Check long_description"
73-
run: "python -m twine check dist/*"
64+
- name: Install poetry, check-wheel-content, and twine
65+
run: python -m pip install build check-wheel-contents twine
66+
- name: Build package
67+
run: python -m build
68+
- name: List result
69+
run: ls -l dist
70+
- name: Check wheel contents
71+
run: check-wheel-contents dist/*.whl
72+
- name: Check long_description
73+
run: python -m twine check dist/*

.pre-commit-config.yaml

Lines changed: 65 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,66 @@
1+
---
12
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: 'v4.1.0'
4-
hooks:
5-
- id: check-merge-conflict
6-
exclude: "rst$"
7-
- repo: https://github.com/asottile/yesqa
8-
rev: v1.3.0
9-
hooks:
10-
- id: yesqa
11-
- repo: https://github.com/Zac-HD/shed
12-
rev: 0.6.0 # 0.7 does not support Python 3.7
13-
hooks:
14-
- id: shed
15-
args:
16-
- --refactor
17-
- --py37-plus
18-
types_or:
19-
- python
20-
- markdown
21-
- rst
22-
- repo: https://github.com/pre-commit/pre-commit-hooks
23-
rev: v4.1.0
24-
hooks:
25-
- id: trailing-whitespace
26-
- id: end-of-file-fixer
27-
- id: fix-encoding-pragma
28-
args: [--remove]
29-
- id: check-yaml
30-
- id: debug-statements
31-
- repo: https://gitlab.com/pycqa/flake8
32-
rev: 3.9.2
33-
hooks:
34-
- id: flake8
35-
language_version: python3
36-
- repo: https://github.com/pre-commit/pygrep-hooks
37-
rev: v1.9.0
38-
hooks:
39-
- id: python-use-type-annotations
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.1.0
5+
hooks:
6+
- id: check-merge-conflict
7+
exclude: rst$
8+
- repo: https://github.com/asottile/yesqa
9+
rev: v1.3.0
10+
hooks:
11+
- id: yesqa
12+
- repo: https://github.com/Zac-HD/shed
13+
rev: 0.6.0 # 0.7 does not support Python 3.7
14+
hooks:
15+
- id: shed
16+
args:
17+
- --refactor
18+
- --py37-plus
19+
types_or:
20+
- python
21+
- markdown
22+
- rst
23+
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
24+
rev: 0.1.0
25+
hooks:
26+
- id: yamlfmt
27+
- repo: https://github.com/pre-commit/pre-commit-hooks
28+
rev: v4.1.0
29+
hooks:
30+
- id: trailing-whitespace
31+
- id: end-of-file-fixer
32+
- id: fix-encoding-pragma
33+
args: [--remove]
34+
- id: check-case-conflict
35+
- id: check-json
36+
- id: check-xml
37+
- id: check-yaml
38+
- id: debug-statements
39+
- repo: https://gitlab.com/pycqa/flake8
40+
rev: 3.9.2
41+
hooks:
42+
- id: flake8
43+
language_version: python3
44+
- repo: https://github.com/pre-commit/pygrep-hooks
45+
rev: v1.9.0
46+
hooks:
47+
- id: python-use-type-annotations
48+
- repo: https://github.com/rhysd/actionlint
49+
rev: v1.6.8
50+
hooks:
51+
- id: actionlint-docker
52+
args:
53+
- -ignore
54+
- 'SC2155:'
55+
- -ignore
56+
- 'SC2086:'
57+
- -ignore
58+
- 'SC1004:'
59+
- repo: https://github.com/sirosen/check-jsonschema
60+
rev: 0.9.1
61+
hooks:
62+
- id: check-github-actions
63+
ci:
64+
skip:
65+
- actionlint-docker
66+
- check-github-actions

0 commit comments

Comments
 (0)