Skip to content

Commit

Permalink
Add integration test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
WillNilges committed Aug 27, 2023
1 parent d3e3331 commit 3b7f446
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Integration

on: [pull_request]

jobs:
integration-test:
runs-on: ubuntu-latest
# services:
# postgres:
# image: postgres:latest
# # `POSTGRES_HOST` is `postgres`
# env:
# POSTGRES_DB: nycmesh-dev
# POSTGRES_USER: nycmesh
# POSTGRES_PASSWORD: helloThisIsATest
# POSTGRES_PORT: 5432
# ports:
# # maps tcp port 5432 on service container to the host
# - 5432:5432
# # set health checks to wait until postgres has started
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5

steps:
- uses: actions/checkout@v3
- uses: isbang/[email protected]
with:
compose-file: "./docker-compose.yml"
down-flags: "--volumes"
services: |
postgres
meshdb
env:
DB_NAME: nymesh-dev
DB_USER: nycmesh
DB_HOST: postgres
DB_PASSWORD: helloThisIsATest
- name: "Run Integration Test Script"
run: |
pip install -r tests/requirements.txt
pytest .
env:
DB_NAME: nymesh-dev
DB_USER: nycmesh
DB_HOST: postgres
DB_PASSWORD: helloThisIsATest
10 changes: 10 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Lint

on: [pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
1 change: 1 addition & 0 deletions docker-compose.yml
2 changes: 1 addition & 1 deletion tests/run_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -e

podman build --tag meshdb_integration -f ./tests/Dockerfile .

podman run --rm --network meshdb_api -env-file=.env -it meshdb_integration:latest
podman run --rm --network meshdb_api --env-file=.env -it meshdb_integration:latest

0 comments on commit 3b7f446

Please sign in to comment.