forked from byceps/byceps
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (72 loc) · 1.91 KB
/
test.yml
File metadata and controls
84 lines (72 loc) · 1.91 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
name: Test
on:
push:
branches: [ main ]
paths-ignore:
- 'docs/**'
- 'helm/**'
- '*.rst'
pull_request:
branches: [ main ]
paths-ignore:
- 'docs/**'
- 'helm/**'
- '*.rst'
# Allow manual workflow triggering from the "Actions" tab.
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: byceps_test
POSTGRES_PASSWORD: test
POSTGRES_DB: byceps_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Make accessible on localhost.
- 5432:5432
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Make accessible on localhost.
- 6379:6379
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'requirements.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r requirements.txt -r requirements-test.txt
- name: Install BYCEPS
run: |
python -m pip install -e .
- name: Test with pytest
run: |
pytest
- name: Post result to Discord
if: always()
env:
JOB_RESULT: ${{ job.status }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
run: python ./.github/workflows/send-workflow-result-to-discord.py $JOB_RESULT $DISCORD_WEBHOOK_URL