-
Notifications
You must be signed in to change notification settings - Fork 101
217 lines (215 loc) · 6.99 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
name: CI
on:
push:
branches:
- main
pull_request_target:
branches:
- main
types: [labeled]
jobs:
common:
name: common
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || ${{ github.event_name }} == 'push'
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- uses: actions-rs/cargo@v1
name: format check
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
name: clippy check
with:
command: clippy
args: -- -D warnings
- name: Setup gcloud
uses: google-github-actions/[email protected]
with:
service_account_key: ${{ secrets.STORAGE_CREDENTIALS }}
export_default_credentials: true
- uses: actions-rs/cargo@v1
name: auth-test
with:
command: test
args: --release --all-features --manifest-path foundation/auth/Cargo.toml
- uses: actions-rs/cargo@v1
name: gax-test
with:
command: test
args: --release --all-features --manifest-path foundation/gax/Cargo.toml
- name: cargo-deny
uses: EmbarkStudios/cargo-deny-action@v1
with:
arguments: --workspace --all-features
pubsub:
name: pubsub
runs-on: ubuntu-latest
services:
pubsub:
image: messagebird/gcloud-pubsub-emulator:latest
ports:
- 8681:8681
env:
PUBSUB_PROJECT1: "local-project,test-topic:test-subscription,test-topic1:test-subscription1"
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
name: test
with:
command: test
args: --release --all-features --manifest-path pubsub/Cargo.toml
env:
PUBSUB_EMULATOR_HOST: localhost:8681
RUSTFLAGS: "-A dead_code -A unused"
spanner:
name: spanner
runs-on: ubuntu-latest
services:
spanner:
image: gcr.io/cloud-spanner-emulator/emulator
ports:
- 9020:9020
- 9010:9010
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: setup spanner
run: |
gcloud config configurations create emulator
gcloud config set auth/disable_credentials true
gcloud config set project local-project
gcloud config set api_endpoint_overrides/spanner http://localhost:9020/
gcloud spanner instances create test-instance --config=emulator-config --description="Test Instance" --nodes=1
- name: migration
uses: docker://mercari/wrench:1.0.4
with:
args: "create --directory spanner/tests/ddl"
env:
SPANNER_PROJECT_ID: local-project
SPANNER_INSTANCE_ID: test-instance
SPANNER_DATABASE_ID: local-database
SPANNER_EMULATOR_HOST: 172.17.0.1:9010
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup gcloud
uses: google-github-actions/[email protected]
with:
service_account_key: ${{ secrets.STORAGE_CREDENTIALS }}
export_default_credentials: true
- uses: actions-rs/cargo@v1
name: test
with:
command: test
args: --release --all-features --manifest-path spanner/Cargo.toml
env:
SPANNER_EMULATOR_HOST: localhost:9010
RUSTFLAGS: "-A dead_code -A unused"
- uses: actions-rs/cargo@v1
name: test-derive
with:
command: test
args: --release --all-features --manifest-path spanner-derive/Cargo.toml
env:
SPANNER_EMULATOR_HOST: localhost:9010
RUSTFLAGS: "-A dead_code -A unused"
storage:
name: storage
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || ${{ github.event_name }} == 'push'
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Setup gcloud
uses: google-github-actions/[email protected]
with:
service_account_key: ${{ secrets.STORAGE_CREDENTIALS }}
export_default_credentials: true
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
name: test
with:
command: test
args: --release --all-features --manifest-path storage/Cargo.toml
env:
RUSTFLAGS: "-A dead_code -A unused"
bigquery:
name: bigquery
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || ${{ github.event_name }} == 'push'
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Setup gcloud
uses: google-github-actions/[email protected]
with:
service_account_key: ${{ secrets.STORAGE_CREDENTIALS }}
export_default_credentials: true
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
name: test
with:
command: test
args: --release --all-features --manifest-path bigquery/Cargo.toml
env:
RUSTFLAGS: "-A dead_code -A unused"