build yaml init
This commit is contained in:
parent
e4fe099f8c
commit
7487fc84df
55
.github/workflows/build.yml
vendored
Normal file
55
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop, master ]
|
||||
pull_request:
|
||||
branches: [ main, develop, master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install Graphviz
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y graphviz
|
||||
|
||||
- name: Install project dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
pip install pytest flake8 yamllint || true
|
||||
|
||||
- name: Lint YAML
|
||||
run: |
|
||||
if command -v yamllint >/dev/null; then
|
||||
yamllint .
|
||||
else
|
||||
echo "yamllint not installed"
|
||||
fi
|
||||
|
||||
- name: Lint Python
|
||||
run: |
|
||||
if ls **/*.py >/dev/null 2>&1; then
|
||||
flake8 .
|
||||
else
|
||||
echo "No Python files; skipping flake8"
|
||||
fi
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
if [ -d tests ]; then
|
||||
pytest -q
|
||||
else
|
||||
echo "No tests directory; skipping pytest"
|
||||
fi
|
||||
Loading…
x
Reference in New Issue
Block a user