You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by ak...@apache.org on 2022/11/28 18:51:59 UTC
[age] branch master updated: Implement CI testing for Golang Driver (#372)
This is an automated email from the ASF dual-hosted git repository.
ako pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/age.git
The following commit(s) were added to refs/heads/master by this push:
new 69f9a91 Implement CI testing for Golang Driver (#372)
69f9a91 is described below
commit 69f9a91f3e547ac17b034fbc11c463e1b4fa6ac3
Author: Luke Hinds <70...@users.noreply.github.com>
AuthorDate: Mon Nov 28 18:51:52 2022 +0000
Implement CI testing for Golang Driver (#372)
This change will implement running of the go driver unit tests
upon every pull commit made to the `drivers/golang` code.
It uses the `paths` directive to ensure the github action workflow
only runs when the go driver code is changed.
The docker-compose file is required to instaniate a postgres
instance, needed for unit testing.
---
.github/workflows/go-driver.yml | 33 +++++++++++++++++++++++++++++++++
drivers/golang/docker-compose.yml | 10 ++++++++++
2 files changed, 43 insertions(+)
diff --git a/.github/workflows/go-driver.yml b/.github/workflows/go-driver.yml
new file mode 100644
index 0000000..52febad
--- /dev/null
+++ b/.github/workflows/go-driver.yml
@@ -0,0 +1,33 @@
+name: Go Driver Tests
+
+on:
+ push:
+ branches: [ "master" ]
+ paths:
+ - 'drivers/golang'
+ pull_request:
+ branches: [ "master" ]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: drivers/golang/age/
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Run apache/age docker image
+ run: docker-compose up -d
+
+ - name: Set up Go
+ uses: actions/setup-go@v3
+ with:
+ go-version: 1.16
+
+ - name: Build
+ run: go build -v ./...
+
+ - name: Test
+ run: go test . -v
diff --git a/drivers/golang/docker-compose.yml b/drivers/golang/docker-compose.yml
new file mode 100644
index 0000000..668eb19
--- /dev/null
+++ b/drivers/golang/docker-compose.yml
@@ -0,0 +1,10 @@
+version: "3.3"
+services:
+ db:
+ image: apache/age
+ environment:
+ - POSTGRES_USER=postgres
+ - POSTGRES_PASSWORD=agens
+ - POSTGRES_DB=postgres
+ ports:
+ - 5432:5432
\ No newline at end of file