|
| 1 | +permissions: |
| 2 | + contents: read |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + paths: |
| 7 | + - 'packages/sqlalchemy-spanner/**' |
| 8 | + - '.github/workflows/sqlalchemy-spanner-compliance-tests-against-emulator.yml' |
| 9 | + push: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + paths: |
| 13 | + - 'packages/sqlalchemy-spanner/**' |
| 14 | + - '.github/workflows/sqlalchemy-spanner-compliance-tests-against-emulator.yml' |
| 15 | + |
| 16 | +defaults: |
| 17 | + run: |
| 18 | + working-directory: packages/sqlalchemy-spanner |
| 19 | + |
| 20 | +name: Run SQLAlchemy Spanner compliance tests against emulator |
| 21 | +jobs: |
| 22 | + check_changes: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + outputs: |
| 25 | + run_sqlalchemy_spanner: ${{ steps.filter.outputs.sqlalchemy_spanner }} |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 28 | + with: |
| 29 | + persist-credentials: false |
| 30 | + - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 |
| 31 | + id: filter |
| 32 | + with: |
| 33 | + filters: | |
| 34 | + sqlalchemy_spanner: |
| 35 | + - 'packages/sqlalchemy-spanner/**' |
| 36 | + - '.github/workflows/sqlalchemy-spanner-compliance-tests-against-emulator.yml' |
| 37 | +
|
| 38 | + compliance-tests: |
| 39 | + needs: check_changes |
| 40 | + if: ${{ needs.check_changes.outputs.run_sqlalchemy_spanner == 'true' }} |
| 41 | + runs-on: ubuntu-latest |
| 42 | + |
| 43 | + services: |
| 44 | + emulator: |
| 45 | + image: gcr.io/cloud-spanner-emulator/emulator:latest # zizmor: ignore[unpinned-images] |
| 46 | + ports: |
| 47 | + - 9010:9010 |
| 48 | + - 9020:9020 |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Checkout code |
| 52 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 53 | + with: |
| 54 | + persist-credentials: false |
| 55 | + - name: Set up Python 3.10 |
| 56 | + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 |
| 57 | + with: |
| 58 | + python-version: "3.10" |
| 59 | + - name: Install nox |
| 60 | + run: python -m pip install nox |
| 61 | + - name: Run nox compliance_test_20 |
| 62 | + run: nox -s compliance_test_20 |
| 63 | + env: |
| 64 | + SPANNER_EMULATOR_HOST: localhost:9010 |
| 65 | + GOOGLE_CLOUD_PROJECT: emulator-test-project |
| 66 | + GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE: true |
0 commit comments