-
Notifications
You must be signed in to change notification settings - Fork 61
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
b4158bf
commit 3722f40
Showing
5 changed files
with
666 additions
and
1 deletion.
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,33 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Set up Docker Compose | ||
run: sudo apt-get install docker-compose | ||
|
||
- name: Build and run pgai-tests | ||
run: docker-compose run pgai-tests |
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
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,51 @@ | ||
services: | ||
postgres: | ||
image: pgai:ci | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
target: pgai-tests | ||
environment: | ||
POSTGRES_DB: postgres | ||
HTTPS_PROXY: hoverfly:8500 | ||
HTTP_PROXY: hoverfly:8500 | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
REQUESTS_CA_BUNDLE: /usr/local/share/ca-certificates/hoverfly.crt | ||
SSL_CERT_FILE: /usr/local/share/ca-certificates/hoverfly.crt | ||
ports: | ||
- "5432:5432" | ||
depends_on: | ||
- hoverfly | ||
pgai-tests: | ||
image: postgres:alpine | ||
command: | ||
environment: | ||
ENABLE_COHERE_TESTS: 1 | ||
COHERE_API_KEY: cohere_api | ||
depends_on: | ||
- postgres | ||
volumes: | ||
- .:/sql-scripts | ||
entrypoint: | | ||
/bin/sh -c " | ||
until pg_isready -h postgres -U postgres; do | ||
echo 'Waiting for postgres to be ready...' | ||
sleep 2 | ||
done | ||
cd /sql-scripts | ||
psql -d postgres -f test.sql -h postgres -U postgres | ||
" | ||
restart: "no" | ||
|
||
hoverfly: | ||
image: spectolabs/hoverfly:latest | ||
volumes: | ||
- ./tests:/config | ||
ports: | ||
- 8888:8888 | ||
- 8500:8500 | ||
# To record the requests, set -spy or -capture. Then retrieve them with | ||
# docker-compose up when it's done, don't kill the containers and run | ||
# docker-compose exec hoverfly -- wget -O - localhost:8888/api/v2/simulation | pbcopy | ||
# command: -capture | ||
command: -import /config/cohere-hoverfly-simulations.json |
Oops, something went wrong.