-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61c1b04
commit 2d394ed
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: testing app | ||
run-name: Test the app | ||
on: | ||
pull_request: | ||
types: [opened, reopened] | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
TEST_DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432 | ||
API_VERSION: 'v1' | ||
SECRET_KEY: 'd76db401004b334d0d79bc041f6c6f54c5f495ef4dc228f500eab4df532248ac' | ||
ALGORITHM: 'HS256' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: ["3.10", "3.11", "3.12"] | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
|
||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: postgres | ||
|
||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- name: all ltree to postgres | ||
run: | | ||
PGPASSWORD=postgres psql -U postgres -h 127.0.0.1 -p ${{ job.services.postgres.ports[5432] }} -d postgres -tc "create extension if not exists ltree;" | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Poetry | ||
run: curl -sSL https://install.python-poetry.org | python3 - | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'poetry' | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-ansi --no-interaction --with dev | ||
|
||
- name: Test | ||
run: poetry run pytest --cov=src -v |