diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml new file mode 100644 index 000000000..4273fe315 --- /dev/null +++ b/.github/workflows/integration.yaml @@ -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/compose-action@v1.5.1 + 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 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 000000000..c2964fb9c --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,10 @@ +name: Lint + +on: [pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: psf/black@stable diff --git a/docker-compose.yml b/docker-compose.yml new file mode 120000 index 000000000..e736cbabe --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1 @@ +docker-compose.yaml \ No newline at end of file diff --git a/tests/run_integration.sh b/tests/run_integration.sh index cb0a2f224..3f5b3f85e 100755 --- a/tests/run_integration.sh +++ b/tests/run_integration.sh @@ -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 \ No newline at end of file +podman run --rm --network meshdb_api --env-file=.env -it meshdb_integration:latest \ No newline at end of file