48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
when:
|
|
- event: [push, pull_request]
|
|
|
|
steps:
|
|
setup:
|
|
image: python:3.11-slim
|
|
commands:
|
|
- echo "=== CI Pipeline Test ==="
|
|
- python --version
|
|
- pip --version
|
|
|
|
install:
|
|
image: python:3.11-slim
|
|
commands:
|
|
- pip install pytest
|
|
- pip install requests
|
|
depends_on: [setup]
|
|
|
|
test:
|
|
image: python:3.11-slim
|
|
commands:
|
|
- pip install pytest requests
|
|
- python -c "import sys; print(f\"Python {sys.version}\")"
|
|
- pytest --version
|
|
- python test_sample.py
|
|
depends_on: [install]
|
|
|
|
notify:
|
|
image: plugins/webhook
|
|
settings:
|
|
urls: https://api.heyami.ai/webhooks/ci/build
|
|
content_type: application/json
|
|
template: |
|
|
{
|
|
"event": "build_{{build.status}}",
|
|
"repo": "{{repo.name}}",
|
|
"branch": "{{commit.branch}}",
|
|
"commit": "{{commit.sha}}",
|
|
"message": "{{commit.message}}",
|
|
"author": "{{commit.author}}",
|
|
"build_number": {{build.number}},
|
|
"build_link": "{{build.link}}",
|
|
"status": "{{build.status}}"
|
|
}
|
|
when:
|
|
- status: [success, failure]
|
|
|