-
Notifications
You must be signed in to change notification settings - Fork 21
150 lines (149 loc) · 5.52 KB
/
ci.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
on:
push:
branches:
- main
pull_request:
name: ci
env:
GOOGLE_CLOUD_PROJECT: "span-cloud-testing"
GOOGLE_CLOUD_INSTANCE: "pgadapter-testing"
GOOGLE_CLOUD_DATABASE: "testdb_e2e_psql"
GOOGLE_CLOUD_ENDPOINT: "spanner.googleapis.com"
JSON_SERVICE_ACCOUNT_CREDENTIALS: ${{ secrets.JSON_SERVICE_ACCOUNT_CREDENTIALS }}
jobs:
check-env:
outputs:
has-key: ${{ steps.project-id.outputs.defined }}
runs-on: ubuntu-latest
steps:
- id: project-id
env:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
if: "${{ env.GCP_PROJECT_ID != '' }}"
run: echo "defined=true" >> "$GITHUB_OUTPUT"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
- run: java -version
- run: .ci/run-with-credentials.sh lint
e2e-psql-v11-v14:
needs: [check-env]
if: needs.check-env.outputs.has-key == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
- run: java -version
- name: "Install postgresql-client-11"
run: |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-client-11
- id: 'auth'
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.JSON_SERVICE_ACCOUNT_CREDENTIALS }}'
- id: 'setup-gcloud'
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ env.GOOGLE_CLOUD_PROJECT }}
- name: "Install gcloud alpha component"
run: gcloud components install alpha
- run: .ci/run-with-credentials.sh uber-jar-build
- run: .ci/run-with-credentials.sh e2e-psql 11 14.1
e2e-psql-v12-v1-v14:
needs: [check-env]
if: needs.check-env.outputs.has-key == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
- run: java -version
- name: "Install postgresql-client-12"
run: |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-client-12
- id: 'auth'
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.JSON_SERVICE_ACCOUNT_CREDENTIALS }}'
- id: 'setup-gcloud'
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ env.GOOGLE_CLOUD_PROJECT }}
- name: "Install gcloud alpha component"
run: gcloud components install alpha
- run: .ci/run-with-credentials.sh uber-jar-build
- run: .ci/run-with-credentials.sh e2e-psql 12 14.1
e2e-psql-v13-v14:
needs: [check-env]
if: needs.check-env.outputs.has-key == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
- run: java -version
- name: "Install postgresql-client-13"
run: |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-client-13
- id: 'auth'
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.JSON_SERVICE_ACCOUNT_CREDENTIALS }}'
- id: 'setup-gcloud'
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ env.GOOGLE_CLOUD_PROJECT }}
- name: "Install gcloud alpha component"
run: gcloud components install alpha
- run: .ci/run-with-credentials.sh uber-jar-build
- run: .ci/run-with-credentials.sh e2e-psql 13 14.1
e2e-psql-v14-v14:
needs: [check-env]
if: needs.check-env.outputs.has-key == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
- run: java -version
- name: "Install postgresql-client-14"
run: |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-client-14
- id: 'auth'
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.JSON_SERVICE_ACCOUNT_CREDENTIALS }}'
- id: 'setup-gcloud'
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ env.GOOGLE_CLOUD_PROJECT }}
- name: "Install gcloud alpha component"
run: gcloud components install alpha
- run: .ci/run-with-credentials.sh uber-jar-build
- run: .ci/run-with-credentials.sh e2e-psql 14 14.1