-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (58 loc) · 1.57 KB
/
pytest.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Run pytest
on:
# push:
# branches:
# - main
# - master
# paths:
# - '**/*.py'
# pull_request:
# branches:
# - main
# - master
# paths:
# - '**/*.py'
workflow_dispatch:
env:
REGISTRY_URL: ${{ vars.REGISTRY_URL }}
REGISTRY_USER: ${{ github.repository_owner }}
IMAGE: ${{ vars.IMAGE }}
PRIV_KEY_B64: ${{ secrets.PRIV_KEY_B64 }}
PUB_KEY_B64: ${{ secrets.PUB_KEY_B64 }}
jobs:
test:
runs-on: ubuntu-latest
# TODO: avoid hardcoding the image name
services:
server:
image: ghcr.io/pythoninthegrass/meetup-bot
container:
image: python:3.11.9-slim-bullseye
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
apt-get -qq update \
&& apt-get -qq install \
--no-install-recommends -y \
curl \
gcc \
git \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip pytest
python -m pip install -r requirements.txt
- name: Wait for server to be ready
run: |
timeout 60s bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' server:3000/healthz)" != "200" ]]; do sleep 5; done' || false
- name: Run pytest
run: pytest -s
env:
PRIV_KEY_B64: ${{ env.PRIV_KEY_B64 }}
PUB_KEY_B64: ${{ env.PUB_KEY_B64 }}
URL: http://server:3000