-
Notifications
You must be signed in to change notification settings - Fork 12
50 lines (41 loc) · 1.28 KB
/
run-tests.yml
File metadata and controls
50 lines (41 loc) · 1.28 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
name: Python conserver unit test
on:
push:
branches: [ main ] # only run on pushes to main branch
pull_request: # all PRs
jobs:
test:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Check out the repository
uses: actions/checkout@v3
- name: Set up Docker
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Copy example_docker-compose.yml to docker-compose.yml
run: |
cp example_docker-compose.yml docker-compose.yml
- name: Create .env file
run: |
echo "REDIS_URL=redis://redis" >> .env
echo "CONSERVER_API_TOKEN=fake-token" >> .env
- name: We need to create Conserver network for now
run: |
docker network create conserver
- name: Build and run services with Docker Compose
run: |
docker-compose up --build --detach
# Step 3: Run Docker container with additional commands
- name: Run tests inside Docker container
run: |
docker-compose run --rm conserver bash -c "
# Install tests dependencies
poetry install &&
# Run the tests
pytest --maxfail=5 --disable-warnings
"
- name: Clean up
if: always()
run: docker-compose down