Код: Выделить всё
name: Python application
on:
push:
branches: [ "app" ]
pull_request:
branches: [ "app" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
make install
- name: Lint with pylint
run: |
make lint
- name: Start Fastapi service
run: |
nohup make serve
- name: Test with pytest
run: |
make test
Код: Выделить всё
install:
pip install -r requirements.txt
lint:
pylint --disable=R,C *.py
serve:
python app.py
test:
python -m pytest -vv test_app.py
Подробнее здесь: https://stackoverflow.com/questions/790 ... ub-actions