Skip to content

chore(migration): Migrate code from googleapis/python-spanner into pa… #128

chore(migration): Migrate code from googleapis/python-spanner into pa…

chore(migration): Migrate code from googleapis/python-spanner into pa… #128

on:
pull_request:
paths:
- 'packages/django-google-spanner/**'
- '.github/workflows/django-spanner-foreign_keys.yaml'
push:
branches:
- main
paths:
- 'packages/django-google-spanner/**'
- '.github/workflows/django-spanner-foreign_keys.yaml'
defaults:
run:
working-directory: packages/django-google-spanner
name: foreign-keys-test
jobs:
check_changes:
runs-on: ubuntu-latest
outputs:
run_django_spanner: ${{ steps.filter.outputs.django_spanner }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
django_spanner:
- 'packages/django-google-spanner/**'
- '.github/workflows/django-spanner-foreign_keys.yaml'
system-tests:
needs: check_changes
if: ${{ needs.check_changes.outputs.run_django_spanner == 'true' }}
runs-on: ubuntu-latest
services:
emulator-0:
image: gcr.io/cloud-spanner-emulator/emulator:latest
ports:
- 9010:9010
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Run Django foreign key test
run: sh foreign_key_test.sh
env:
SPANNER_EMULATOR_HOST: localhost:9010
GOOGLE_CLOUD_PROJECT: emulator-test-project
GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true
SPANNER_TEST_INSTANCE: google-cloud-django-backend-tests