Merge pull request #575 from CartoDB/add-github-actions

add CI tests to github actions
This commit is contained in:
Rafa de la Torre 2020-01-30 16:32:45 +01:00 committed by GitHub
commit b35e67f65a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

47
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: dataservices-api PR testing
on: push
jobs:
dataservices-api-pg10:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup gcloud authentication
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
service_account_key: ${{ secrets.GCS }}
- name: Pull base image
run: gcloud auth configure-docker && docker pull gcr.io/cartodb-on-gcp-ci-testing/cartodb-postgresql-base:10
- 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-pg10.yaml up -d
- name: Install required python libs
run: docker-compose -f docker-compose-pg10.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-pg10.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-pg10.yaml exec -T postgres-server bash -c "cd /dataservices-api/server/extension/ && sudo make clean all install installcheck"
timeout-minutes: 5
- name: Run client tests
run: docker-compose -f docker-compose-pg10.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"
timeout-minutes: 5