Merge pull request #59 from kastaid/dev #538
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: | |
pull_request: | |
push: | |
workflow_dispatch: | |
jobs: | |
linter: | |
name: Run linting and format code | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ['3.9', '3.10'] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.GIT_TOKEN }} | |
- uses: styfle/cancel-workflow-action@0.10.0 | |
with: | |
all_but_latest: true | |
access_token: ${{ secrets.GIT_TOKEN }} | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v3 | |
if: startsWith(runner.os, 'Linux') | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python3 -m pip install -U pip | |
pip3 install -r requirements.txt | |
if [ -f requirements-dev.txt ]; then pip3 install -r requirements-dev.txt; fi | |
- name: Linting and format code | |
run: python3 -m run --lint | |
- uses: illvart/beautysh-action@latest | |
with: | |
args: '*.sh --indent-size 2 &>/dev/null' | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: '[action] ci: auto-fixes' | |
commit_options: '--no-verify' | |
commit_user_name: kastaid | |
commit_user_email: ${{ secrets.EMAIL }} | |
commit_author: kastaid <${{ secrets.EMAIL }}> |