File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Tests
2
+
3
+ on :
4
+ push :
5
+ branches : [main]
6
+ pull_request :
7
+ branches : [main]
8
+
9
+ jobs :
10
+ build-test-deploy :
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - name : Check out code
15
+ uses : actions/checkout@v3
16
+
17
+ - name : Create .env file
18
+ run : |
19
+ echo "PYTHONUNBUFFERED=1" > .env
20
+ echo "FLASK_ENV=development" >> .env
21
+ echo "API_KEY=your_api_key" >> .env
22
+
23
+ - name : Install Docker compose
24
+ run : |
25
+ sudo apt-get update
26
+ sudo apt-get install -y docker-compose
27
+
28
+ - name : Build Docker
29
+ run : |
30
+ docker-compose up -d --build
31
+
32
+ - name : Wait for API
33
+ run : |
34
+ timeout 30 sh -c 'until curl -s http://localhost:8080/; do sleep 2; done'
35
+
36
+ - name : Run API tests
37
+ run : |
38
+ python tests.py
39
+
40
+ - name : Shut down Docker Compose
41
+ if : always()
42
+ run : docker-compose down
You can’t perform that action at this time.
0 commit comments