|
| 1 | +# Copyright 2022 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +on: |
| 16 | + schedule: |
| 17 | + - cron: '0 0 * * *' |
| 18 | + push: |
| 19 | + branches: |
| 20 | + - master |
| 21 | + pull_request: |
| 22 | +name: CI |
| 23 | +jobs: |
| 24 | + test: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + services: |
| 27 | + emulator: |
| 28 | + image: gcr.io/cloud-spanner-emulator/emulator:1.4.9 |
| 29 | + ports: |
| 30 | + - 9010:9010 |
| 31 | + - 9020:9020 |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v2 |
| 34 | + - uses: actions/setup-go@v2 |
| 35 | + with: |
| 36 | + go-version: '1.14' |
| 37 | + - run: go version |
| 38 | + - run: make setup-emulator |
| 39 | + env: |
| 40 | + SPANNER_EMULATOR_HOST: localhost:9010 |
| 41 | + SPANNER_EMULATOR_HOST_REST: localhost:9020 |
| 42 | + PROJECT: fake-project |
| 43 | + INSTANCE: fake-instance |
| 44 | + DATABASE: fake-database |
| 45 | + - name: make test with Cloud Spanner Emulator |
| 46 | + run: make test |
| 47 | + env: |
| 48 | + SPANNER_EMULATOR_HOST: localhost:9010 |
| 49 | + SPANNER_EMULATOR_HOST_REST: localhost:9020 |
| 50 | + PROJECT: fake-project |
| 51 | + INSTANCE: fake-instance |
| 52 | + DATABASE: fake-database |
| 53 | + - name: make test (with a real instance if available) |
| 54 | + run: make test |
| 55 | + env: |
| 56 | + PROJECT: ${{ secrets.PROJECT }} |
| 57 | + INSTANCE: ${{ secrets.INSTANCE }} |
| 58 | + DATABASE: ${{ secrets.DATABASE }} |
| 59 | + CREDENTIAL: ${{ secrets.CREDENTIAL }} |
0 commit comments