-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.28 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: CI Pipeline
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
run: pytest
- name: Notify Telex of Test Success
if: success()
run: |
curl -X POST -H "Content-Type: application/json" -d '{
"event_name": "ci_pipeline",
"username": "GitHub Actions",
"status": "success",
"message": "✅ Tests passed successfully for commit ${{ github.sha }} on branch ${{ github.ref_name }}."
}' ${{ secrets.TELEX_WEBHOOK_URL }}
- name: Notify Telex of Test Failure
if: failure()
run: |
curl -X POST -H "Content-Type: application/json" -d '{
"event_name": "ci_pipeline",
"username": "GitHub Actions",
"status": "failure",
"message": "❌ Tests failed for commit ${{ github.sha }} on branch ${{ github.ref_name }}."
}' ${{ secrets.TELEX_WEBHOOK_URL }}