forked from valkey-io/valkey-glide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48e563f
commit a032fa5
Showing
8 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Go CI | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
paths: | ||
- glide-core/** | ||
- submodules/** | ||
- go/** | ||
- .github/workflows/go.yml | ||
pull_request: | ||
paths: | ||
- glide-core/** | ||
- submodules/** | ||
- go/** | ||
- .github/workflows/go.yml | ||
|
||
# Run only the latest job on a branch and cancel previous ones | ||
concurrency: | ||
group: ${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-and-test-go-client: | ||
timeout-minutes: 25 | ||
strategy: | ||
# Run all jobs | ||
fail-fast: false | ||
matrix: | ||
go: | ||
- '1.18' | ||
- '1.21' | ||
redis: | ||
- 6.2.14 | ||
- 7.2.3 | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up Go ${{ matrix.go }} | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '^1.13.1' | ||
|
||
- name: Install shared software dependencies | ||
uses: ./.github/workflows/install-shared-dependencies | ||
with: | ||
os: ${{ matrix.os }} | ||
target: ${{ matrix.os == 'ubuntu-latest' && 'x86_64-unknown-linux-gnu' || 'x86_64-apple-darwin' }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install redis | ||
# TODO: make this step macos compatible: https://github.com/aws/glide-for-redis/issues/781 | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
uses: ./.github/workflows/install-redis | ||
with: | ||
redis-version: ${{ matrix.redis }} | ||
|
||
- name: Build glide-core | ||
working-directory: ./glide-core | ||
run: cargo build --release | ||
|
||
- name: Build glide | ||
working-directory: ./go/glide | ||
run: cargo build --release | ||
|
||
- name: Generate the Go protobuf files | ||
run: | | ||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
mkdir go/glide/protobuf | ||
protoc --proto_path=glide-core/src/protobuf \ | ||
--go_opt=Mconnection_request.proto=github.com/aws/glide-for-redis/go/glide/protobuf \ | ||
--go_opt=Mredis_request.proto=github.com/aws/glide-for-redis/go/glide/protobuf \ | ||
--go_opt=Mresponse.proto=github.com/aws/glide-for-redis/go/glide/protobuf \ | ||
--go_out=go/glide/protobuf \ | ||
--go_opt=paths=source_relative \ | ||
glide-core/src/protobuf/*.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,7 @@ utils/tls_crts/ | |
|
||
# java compiled files. | ||
*.class | ||
|
||
# Go compilation files | ||
go/**/lib.h | ||
*.pb.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[env] | ||
GLIDE_NAME = { value = "GlideGo", force = true } | ||
GLIDE_VERSION = "0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
name = "glide-rs" | ||
version = "0.1.0" | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
authors = ["Amazon Web Services"] | ||
|
||
build = "build.rs" | ||
|
||
[build-dependencies] | ||
cbindgen = "0.20" | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
redis = { path = "../../submodules/redis-rs/redis", features = ["aio", "tokio-comp", "tls", "tokio-native-tls-comp", "tls-rustls-insecure"] } | ||
glide-core = { path = "../../glide-core" } | ||
tokio = { version = "^1", features = ["rt", "macros", "rt-multi-thread", "time"] } | ||
num-derive = "0.4.0" | ||
num-traits = "0.2.15" | ||
tracing-subscriber = "0.3.16" | ||
protobuf = { version = "3.3.0", features = [] } | ||
|
||
[profile.release] | ||
lto = true | ||
debug = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0 | ||
*/ | ||
|
||
use std::env; | ||
|
||
fn main() { | ||
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); | ||
|
||
cbindgen::Builder::new() | ||
.with_crate(crate_dir) | ||
.with_language(cbindgen::Language::C) | ||
.generate() | ||
.expect("Unable to generate bindings") | ||
.write_to_file("lib.h"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package glide | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
func main() { | ||
fmt.Println("Hello world!") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module github.com/aws/glide-for-redis/go/glide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
println!("Hello World!"); | ||
} |