diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000000..8471646c125 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +name: Build + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -U docutils + + - name: Build + run: make -j$(nproc) + + - name: Deploy + if: > + ( + github.repository == 'python/peps' && + github.ref == 'refs/heads/master' + ) + + run: | + bash deploy.bash diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000000..a3d3a80c399 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +name: Lint + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -U pre-commit + + - name: Lint + run: make lint + env: + PRE_COMMIT_COLOR: always diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000000..abb0d224f09 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,14 @@ +repos: + - repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.6.0 + hooks: + - id: rst-backticks + exclude: > + (?x)^( + pep-0012.rst| + pep-0505.rst| + pep-0550.rst| + pep-0567.rst| + pep-0572.rst + )$ + - id: rst-inline-touching-normal diff --git a/Makefile b/Makefile index 213bb75325f..20f602ddba3 100644 --- a/Makefile +++ b/Makefile @@ -51,3 +51,6 @@ package: all rss cp *.png build/peps/ cp *.rss build/peps/ tar -C build -czf build/peps.tar.gz peps + +lint: + pre-commit run --all-files