new/formatter #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
permissions: | |
contents: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout backend | |
uses: actions/checkout@v4 | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: autoformatter | |
run: pip install autopep8 | |
- name: autopep8 | |
run: autopep8 --in-place --recursive . --exclude ./test/ | |
- name: add commit | |
run: | | |
git config --global user.name 'GitHub Actions Bot' | |
git config --global user.email '[email protected]' | |
git add . | |
git diff --quiet && git diff --staged --quiet || git commit -m "autopep8" | |
- name: run tests | |
run: | | |
cd test | |
pytest . -v | |
- name: push changesgi | |
run: git push | |