File tree Expand file tree Collapse file tree 3 files changed +53
-7
lines changed Expand file tree Collapse file tree 3 files changed +53
-7
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ jobs:
119119 runs-on : ubuntu-latest
120120 strategy :
121121 matrix :
122- python-version : [ 3.10 ]
122+ python-version : [ ' 3.10' ]
123123 services :
124124 postgres :
125125 image : postgres:11
@@ -140,15 +140,12 @@ jobs:
140140 run : |
141141 python -m pip install --upgrade pip
142142 pip install -r requirements.txt
143- pip install coverage
144- pip install coveralls
145143 - name : Enable Postgres Trigram Extension
146144 run : |
147145 PGPASSWORD=postgres psql -U postgres -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} -d ci_db_test -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"
148146 - name : Test with unittest
149147 env :
150148 TEST_DATABASE_URL : postgresql://postgres:postgres@localhost/ci_db_test
151149 TEST_DATABASE_ASYNC_URL : postgresql+asyncpg://postgres:postgres@localhost/ci_db_test
152- run : |
153- python -m coverage run -m unittest
154- coveralls
150+ run : |
151+ python -m unittest discover -s ./tests/test_implementations
Original file line number Diff line number Diff line change 1+ # This is a basic workflow to help you get started with Actions
2+
3+ name : Coverage
4+
5+ # Controls when the workflow will run
6+ on :
7+ push :
8+ branches : [ "main", "develop" ]
9+ pull_request :
10+ branches : [ "main", "develop" ]
11+ # Allows you to run this workflow manually from the Actions tab
12+ workflow_dispatch :
13+
14+ # A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+ jobs :
16+ Coverage :
17+ runs-on : ubuntu-latest
18+ strategy :
19+ matrix :
20+ python-version : [ '3.10' ]
21+ services :
22+ postgres :
23+ image : postgres:11
24+ env :
25+ POSTGRES_USER : postgres
26+ POSTGRES_PASSWORD : postgres
27+ POSTGRES_DB : ci_db_test
28+ ports :
29+ - 5432:5432
30+ options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
31+
32+ steps :
33+ - uses : actions/checkout@master
34+
35+ - name : Set github token
36+ run : echo "GITHUB_TOKEN=${{ secrets.GIT_TOKEN }}" >> $GITHUB_ENV
37+ - name : Set coveralls token
38+ run : echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV
39+ - name : pip install, make coverage
40+ env :
41+ TEST_DATABASE_URL : postgresql://postgres:postgres@localhost/ci_db_test
42+ TEST_DATABASE_ASYNC_URL : postgresql+asyncpg://postgres:postgres@localhost/ci_db_test
43+ run : |
44+ python -m pip install --upgrade pip
45+ pip install -r requirements.txt
46+ pip install coverage
47+ pip install coveralls
48+ python -m coverage run -m unittest
49+ coveralls
Original file line number Diff line number Diff line change @@ -34,4 +34,4 @@ class User(Base):
3434app = FastAPI ()
3535app .include_router (crud_route_1 )
3636app .include_router (crud_route_2 )
37- uvicorn .run (app , host = "0.0.0.0" , port = 8002 , debug = False )
37+ uvicorn .run (app , host = "0.0.0.0" , port = 8002 )
You can’t perform that action at this time.
0 commit comments