dataservices-api/.github/workflows/main.yml
Miguel Angel Moreno d8b00307cd Revert "UPgrade pip"
This reverts commit 1925bb6082.
2022-03-07 16:53:12 +01:00

62 lines
2.8 KiB
YAML

name: dataservices-api PR testing
on: push
jobs:
dataservices-api:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pg_version: [10, 12]
env:
PG_VERSION: ${{ matrix.pg_version }}
steps:
- uses: actions/checkout@v1
- name: Set CLOUDSDK_PYTHON path
run: echo "CLOUDSDK_PYTHON=/usr/bin/python" >> $GITHUB_ENV
- name: Set up docker registry
env:
SA_TO_USE: ${{ secrets.GCS }}
run: |
echo "${SA_TO_USE}" | base64 -d | docker login -u _json_key --password-stdin https://gcr.io
- name: Pull base image
run: docker pull gcr.io/cartodb-on-gcp-ci-testing/cartodb-postgresql-base:${{ matrix.pg_version }}
- 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
run: docker-compose -f docker-compose.yaml up -d
- name: Install required python3 libs
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"
if: env.PG_VERSION == 12
- 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"
- name: Run python library tests
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"
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
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)"
timeout-minutes: 5
- name: Run client tests
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)"
timeout-minutes: 5