File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Continuous Integration
2+
3+ on :
4+ push :
5+ paths-ignore :
6+ - ' ansible'
7+ - ' README.md'
8+ pull_request :
9+ paths-ignore :
10+ - ' ansible'
11+ - ' README.md'
12+
13+ jobs :
14+ build :
15+ name : Build and test
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : actions/checkout@v4
19+ - run : docker build --target test --tag todo-app:test .
20+ - run : docker run --env-file .env.test todo-app:test
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ COPY todo_app /app/todo_app
1818
1919EXPOSE 8000
2020
21+ FROM base as test
22+
23+ ENTRYPOINT poetry run pytest
24+
2125FROM base as production
2226
2327ENV FLASK_DEBUG=false
Original file line number Diff line number Diff line change @@ -114,6 +114,14 @@ docker run -dit \
114114 todo-app:dev
115115```
116116
117+ Run tests:
118+ ``` bash
119+ docker build --target test --tag todo-app:test .
120+ docker run -it \
121+ --env-file .env.test \
122+ todo-app:test
123+ ```
124+
117125Run the project in production environment:
118126``` bash
119127docker build --target production --tag todo-app:prod .
You can’t perform that action at this time.
0 commit comments