Skip to content

Commit 6703476

Browse files
authored
Migrate CI runner from CircleCI to GitHub Actions (#143)
1 parent 0ec9c18 commit 6703476

3 files changed

Lines changed: 60 additions & 31 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/run-tests.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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 }}

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
spanner-cli [![CircleCI](https://circleci.com/gh/cloudspannerecosystem/spanner-cli.svg?style=svg)](https://circleci.com/gh/cloudspannerecosystem/spanner-cli)
1+
spanner-cli [![run-tests](https://github.com/cloudspannerecosystem/spanner-cli/actions/workflows/run-tests.yaml/badge.svg)](https://github.com/cloudspannerecosystem/spanner-cli/actions/workflows/run-tests.yaml)
22
===
33

44
Interactive command line tool for Cloud Spanner.
@@ -334,12 +334,6 @@ Run integration tests, which connects to real Cloud Spanner database.
334334
$ PROJECT=${PROJECT_ID} INSTANCE=${INSTANCE_ID} DATABASE=${DATABASE_ID} CREDENTIAL=${CREDENTIAL} make test
335335
```
336336

337-
Run integration tests in [CircleCI Local CLI](https://circleci.com/docs/2.0/local-cli/), which connects to [Cloud Spanner Emulator](https://cloud.google.com/spanner/docs/emulator?hl=en).
338-
339-
```
340-
$ circleci local execute
341-
```
342-
343337
## TODO
344338

345339
* Show secondary index by "SHOW CREATE TABLE"

0 commit comments

Comments
 (0)