File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : pytests in Docker-compose Actions Workflow
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+ pull_request :
7+ branches : [ "main" ]
8+ workflow_dispatch :
9+
10+ jobs :
11+
12+ test :
13+
14+ runs-on : ubuntu-latest
15+
16+ steps :
17+ - uses : actions/checkout@v4
18+
19+ - name : Build the Docker images
20+ run : docker compose build
21+
22+ - name : Create .env file
23+ run : |
24+ echo "STEMWEB_REDIS=redis://redis:6379" >> .env
25+ echo "STEMWEB_DBENGINE=mysql" >> .env
26+ echo "STEMWEB_DBNAME=stemwebdb_v1" >> .env
27+ echo "STEMWEB_DBUSER=stemweb" >> .env
28+ echo "STEMWEB_DBPASSW=ChangeIt" >> .env
29+ echo "STEMWEB_DBHOST=mysql" >> .env
30+ echo "STEMWEB_DBPORT=3306" >> .env
31+ echo "STEMWEB_SECRET_KEY=someth1ngNotTr1via!" >> .env
32+ echo "CALC_HARD_TIMEOUT=120" >> .env
33+ echo "CALC_SOFT_TIMEOUT=60" >> .env
34+
35+ - name : Start the Docker containers
36+ run : docker compose --profile testing up -d
37+
38+ - name : Wait for app to start
39+ run : |
40+ for i in {1..40}; do
41+ curl -s idp:8000 && break
42+ echo "Waiting..."
43+ sleep 1
44+ done
45+
46+ - name : Test with pytest executed within testing client container
47+ run : docker exec stemweb-client-1 pytest -v test_stemweb.py
You can’t perform that action at this time.
0 commit comments