2020-01-30 22:50:49 +08:00
|
|
|
name: dataservices-api PR testing
|
|
|
|
on: push
|
|
|
|
jobs:
|
2020-02-05 01:11:34 +08:00
|
|
|
dataservices-api:
|
2020-01-30 22:50:49 +08:00
|
|
|
runs-on: ubuntu-latest
|
2020-02-05 01:11:34 +08:00
|
|
|
strategy:
|
2020-04-02 21:28:50 +08:00
|
|
|
fail-fast: false
|
2020-02-05 01:11:34 +08:00
|
|
|
matrix:
|
|
|
|
pg_version: [10, 12]
|
|
|
|
env:
|
|
|
|
PG_VERSION: ${{ matrix.pg_version }}
|
2020-01-30 22:50:49 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
|
2020-09-23 16:16:46 +08:00
|
|
|
- name: Set CLOUDSDK_PYTHON path
|
2020-11-18 01:00:48 +08:00
|
|
|
run: echo "CLOUDSDK_PYTHON=/usr/bin/python" >> $GITHUB_ENV
|
2020-09-23 16:16:46 +08:00
|
|
|
|
2020-01-30 22:50:49 +08:00
|
|
|
- name: Setup gcloud authentication
|
|
|
|
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
|
|
|
|
with:
|
|
|
|
service_account_key: ${{ secrets.GCS }}
|
|
|
|
|
|
|
|
- name: Pull base image
|
2020-02-05 01:11:34 +08:00
|
|
|
run: gcloud auth configure-docker && docker pull gcr.io/cartodb-on-gcp-ci-testing/cartodb-postgresql-base:${{ matrix.pg_version }}
|
2020-01-30 22:50:49 +08:00
|
|
|
|
|
|
|
- name: Checkout ci tools repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
repository: CartoDB/ci-tools
|
|
|
|
path: ci-tools
|
|
|
|
token: ${{ secrets.CARTOFANTE_PAT }}
|
|
|
|
|
|
|
|
- name: Copy ci files to root
|
|
|
|
run: cp ci-tools/repos/${{ github.event.repository.name }}/* .
|
|
|
|
|
|
|
|
- name: Start docker-compose services
|
2020-02-05 01:11:34 +08:00
|
|
|
run: docker-compose -f docker-compose.yaml up -d
|
2020-01-30 22:50:49 +08:00
|
|
|
|
2020-02-27 17:14:42 +08:00
|
|
|
- name: Install required python3 libs
|
2020-02-27 01:52:26 +08:00
|
|
|
run: docker-compose -f docker-compose.yaml exec -T postgres-server bash -c "cd /dataservices-api/server/ && sudo pip3 install -U -r ./lib/python/cartodb_services/requirements.txt && sudo pip3 install -U ./lib/python/cartodb_services"
|
2020-02-27 17:19:13 +08:00
|
|
|
if: env.PG_VERSION == 12
|
2020-02-27 17:14:42 +08:00
|
|
|
|
|
|
|
- name: Install required python libs
|
|
|
|
run: docker-compose -f docker-compose.yaml exec -T postgres-server bash -c "cd /dataservices-api/server/ && pip install -U -r ./lib/python/cartodb_services/requirements.txt && pip install -U ./lib/python/cartodb_services"
|
2020-01-30 22:50:49 +08:00
|
|
|
|
|
|
|
- name: Run python library tests
|
2020-02-05 01:11:34 +08:00
|
|
|
run: docker-compose -f docker-compose.yaml exec -T postgres-server bash -c "cd /dataservices-api/server/ && MAPBOX_API_KEY=$MAPBOX_API_KEY TOMTOM_API_KEY=$TOMTOM_API_KEY GEOCODIO_API_KEY=$GEOCODIO_API_KEY nosetests lib/python/cartodb_services/test"
|
2020-01-30 22:50:49 +08:00
|
|
|
env:
|
|
|
|
MAPBOX_API_KEY: ${{ secrets.MAPBOX_API_KEY }}
|
|
|
|
TOMTOM_API_KEY: ${{ secrets.TOMTOM_API_KEY }}
|
|
|
|
GEOCODIO_API_KEY: ${{ secrets.GEOCODIO_API_KEY }}
|
|
|
|
timeout-minutes: 5
|
|
|
|
|
|
|
|
- name: Run server tests
|
2020-04-02 21:33:30 +08:00
|
|
|
run: docker-compose -f docker-compose.yaml exec -T postgres-server bash -c "cd /dataservices-api/server/extension/ && sudo make clean all install installcheck || (cat /dataservices-api/server/extension/test/regression.diffs && false)"
|
2020-01-30 22:50:49 +08:00
|
|
|
timeout-minutes: 5
|
|
|
|
|
|
|
|
- name: Run client tests
|
2020-04-02 21:33:30 +08:00
|
|
|
run: docker-compose -f docker-compose.yaml exec -T postgres-server bash -c "sudo createuser publicuser --no-createrole --no-createdb --no-superuser -U postgres && cd /dataservices-api/client/ && sudo make clean all install installcheck || (cat /dataservices-api/client/test/regression.diffs && false)"
|
2020-01-30 22:50:49 +08:00
|
|
|
timeout-minutes: 5
|