-
Notifications
You must be signed in to change notification settings - Fork 25
46 lines (46 loc) · 1.71 KB
/
integration-tests-against-docker.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
on:
# This allows manual activation of this action for testing.
workflow_dispatch:
# pull_request:
# branches: [ postgresql-dialect ]
name: integration-tests-against-docker
jobs:
integration_tests:
runs-on: ubuntu-latest
env:
GOOGLE_CLOUD_INSTANCE: "pgadapter-testing"
GOOGLE_CLOUD_DATABASE: "e2e_docker"
GOOGLE_CLOUD_ENDPOINT: "spanner.googleapis.com"
DOCKERFILE: "build/Dockerfile.ci"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'zulu'
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.JSON_SERVICE_ACCOUNT_CREDENTIALS }}'
export_environment_variables: true
- name: Randomize database name
run: echo GOOGLE_CLOUD_DATABASE=${GOOGLE_CLOUD_DATABASE}_$(date +%s) >> $GITHUB_ENV
- name: Build Docker image
run: docker build . -f build/Dockerfile -t pgadapter
- name: Start Docker container
run: |
docker run \
-d -p 5432:5432 \
-v ${{env.GOOGLE_APPLICATION_CREDENTIALS}}:/credentials.json:ro \
-e GOOGLE_APPLICATION_CREDENTIALS=/credentials.json \
pgadapter \
-p ${{env.GOOGLE_CLOUD_PROJECT}} -i ${{env.GOOGLE_CLOUD_INSTANCE}} -d ${{env.GOOGLE_CLOUD_DATABASE}} \
-x
- name: Run integration tests
run: |
mvn verify \
-Dclirr.skip=true \
-DskipITs=false \
-DPG_ADAPTER_ADDRESS="localhost" \
-DPG_ADAPTER_LOCAL_PORT="5432" \
-DPG_ADAPTER_DATABASE="${{env.GOOGLE_CLOUD_DATABASE}}"