-
Notifications
You must be signed in to change notification settings - Fork 29
106 lines (88 loc) · 2.71 KB
/
ci.yml
File metadata and controls
106 lines (88 loc) · 2.71 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: CI
on:
pull_request:
permissions:
contents: read
jobs:
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov future requests
- name: Install package in development mode
run: pip install -e .
- name: Run unit tests with coverage
run: |
pytest --cov-report=term-missing --cov=logzio tests/ -v --ignore=tests/e2e/
- name: Upload coverage report
if: matrix.python-version == '3.11'
uses: actions/upload-artifact@v7
with:
name: coverage-report
path: .coverage
retention-days: 5
e2e-integration:
name: E2E Integration Test
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest requests
- name: Install package in development mode
run: pip install -e .
- name: Generate unique ENV_ID
id: env-id
run: echo "value=e2e-${{ github.run_id }}-${{ github.run_attempt }}" >> $GITHUB_OUTPUT
- name: Run E2E integration test
env:
LOGZIO_TOKEN: ${{ secrets.LOGZIO_TOKEN }}
LOGZIO_API_KEY: ${{ secrets.LOGZIO_API_KEY }}
ENV_ID: ${{ steps.env-id.outputs.value }}
run: |
pytest tests/e2e/test_logzio_e2e.py -v --tb=long
ci-success:
name: CI Success
runs-on: ubuntu-latest
needs: [test, e2e-integration]
if: always()
steps:
- name: Check all jobs passed
run: |
if [[ "${{ needs.test.result }}" != "success" ]]; then
echo "Test job failed"
exit 1
fi
if [[ "${{ needs.e2e-integration.result }}" != "success" ]]; then
echo "E2E integration job failed"
exit 1
fi
echo "All CI checks passed! ✅"