Skip to content

Create greet workflow #3

Create greet workflow

Create greet workflow #3

Workflow file for this run

name: CI
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
env: # configure environment variables for git commits
actor: "41898282+github-actions[bot]"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest black flake8 # also install black & flake8
if [ -f requirements.txt ]; then
pip install -r requirements.txt
fi
- name: Configure git # use the environment variable we set above
run: |
git config --local user.email "${actor}@users.noreply.github.com"
git config --local user.name "$actor"
git checkout ci
- name: Test
run: |
pytest .
- name: Format & lint
run: |
black . # first run black, then run flake8
flake8 --extend-ignore E203 --max-line-length 88 .
- name: Commit and push changes
run: |
git add .
git commit -m "🎨 Style code" || echo "No changes to commit"
git push