File tree Expand file tree Collapse file tree 2 files changed +35
-5
lines changed
Expand file tree Collapse file tree 2 files changed +35
-5
lines changed Original file line number Diff line number Diff line change 1818 POSTGRES_DB : db_test
1919 ports :
2020 - 5432:5432
21- # needed because the postgres container does not provide a healthcheck
2221 options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2322 steps :
2423 - name : Checkout code
4039 - name : Install Python dependencies
4140 run : python -m pip install -r requirements.txt
4241
43- - name : Unit Tests
42+ - name : Unit Tests and Integration Tests
4443 env :
4544 DATABASE_TEST_URL : postgresql://db_user:db_password@localhost/db_test
4645 run : python -m flask tests
Original file line number Diff line number Diff line change 33 pull_request :
44 branches : staging
55jobs :
6- my-job :
6+ build-test :
77 runs-on : ubuntu-latest
8+ services :
9+ postgres :
10+ image : postgres:13.3
11+ env :
12+ POSTGRES_USER : db_user
13+ POSTGRES_PASSWORD : db_password
14+ POSTGRES_DB : db_test
15+ ports :
16+ - 5432:5432
17+ options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
818 steps :
9- - name : my-step
10- run : echo "Hello World with Github Actions"
19+ - name : Checkout code
20+ uses : actions/checkout@v2
21+
22+ - name : Cache Python dependencies
23+ uses : actions/cache@v2
24+ with :
25+ path : ~/.cache/pip
26+ key : ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
27+ restore-keys : |
28+ ${{ runner.os }}-pip-
29+
30+ - name : Set up Python 3.9
31+ uses : actions/setup-python@v2
32+ with :
33+ python-version : 3.9
34+
35+ - name : Install Python dependencies
36+ run : python -m pip install -r requirements.txt
37+
38+ - name : Unit Tests and Integration Tests
39+ env :
40+ DATABASE_TEST_URL : postgresql://db_user:db_password@localhost/db_test
41+ run : python -m flask tests
You can’t perform that action at this time.
0 commit comments