Auto apply version metadata fixes

This commit is contained in:
Rikko 2022-08-31 19:23:20 +05:30
parent f29008acdb
commit ec9f1e1b71
4 changed files with 41 additions and 77 deletions

View file

@ -1,25 +0,0 @@
name: Apply Version Metadata
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Auto Apply Version Metadata
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply version metadata
run: |
python test/auto_apply_version_metadata.py

41
.github/workflows/checks.yml vendored Normal file
View file

@ -0,0 +1,41 @@
name: Apply PEP8, Metadata, and Run Tests
on:
pull_request_target:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install autopep8
pip install -r test/pip_reqs.txt
- name: Apply PEP8
run: |
autopep8 --in-place --recursive .
- name: Apply Version Metadata
run: |
python test/auto_apply_version_metadata.py $(git log --pretty=format:'%h' -n 1)
- name: Apply Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[ci] auto-format"
branch: ${{ github.head_ref }}
- name: Execute Tests
run: |
python -m unittest discover -v

View file

@ -1,25 +0,0 @@
name: Code Style
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Execute Flake8
run: |
flake8 $(git ls-files '*.py')

View file

@ -1,27 +0,0 @@
name: Tests
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r test/pip_reqs.txt
- name: Execute Tests
run: |
python -m unittest discover -v