-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (43 loc) · 2.01 KB
/
pr_workflow.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
name: Run Tests on Pull Request
on:
pull_request:
branches:
- '**'
workflow_dispatch: # Manual trigger
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Install Docker Compose (if necessary)
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
# Navigate to the directory containing the docker-compose-testing.yml
- name: Navigate to Docker Testing Directory
run: |
cd docker/_testing
# Start the Python container to build the dist file first
- name: Build dist file in Python container
run: |
sudo docker-compose -f docker/_testing/docker-compose-testing.yml up -d python_app
sudo docker-compose -f docker/_testing/docker-compose-testing.yml exec python_app sh -c "pyinstaller server.spec && ls /tmp/dist"
# Start all other containers after the dist is generated
- name: Start the rest of the containers
run: |
sudo docker-compose -f docker/_testing/docker-compose-testing.yml up -d ubuntu_server centos_server debian_server fedora_server arch_server
# Check if the dist file exists in all containers
- name: Verify dist file in all containers
run: |
sudo docker-compose -f docker/_testing/docker-compose-testing.yml exec ubuntu_server ls /tmp/dist
sudo docker-compose -f docker/_testing/docker-compose-testing.yml exec centos_server ls /tmp/dist
sudo docker-compose -f docker/_testing/docker-compose-testing.yml exec debian_server ls /tmp/dist
sudo docker-compose -f docker/_testing/docker-compose-testing.yml exec fedora_server ls /tmp/dist
sudo docker-compose -f docker/_testing/docker-compose-testing.yml exec arch_server ls /tmp/dist
# Run pytest in the python_app container
- name: Run Pytest
run: |
sudo docker-compose -f docker/_testing/docker-compose-testing.yml exec python_app pytest