Skip to content

CLIENT-3749 Path Expressions #833

CLIENT-3749 Path Expressions

CLIENT-3749 Path Expressions #833

Workflow file for this run

# Aerospike Go Client Tests
#
# Supports custom server configurations via workflow_dispatch
# - Use {{VAR_NAME}} placeholders for secrets (e.g., {{QE_DOCKER_USERNAME}})
# - Add secrets: Repository Settings → env section (line ~56) → JSON template
# - Fields: version (required), docker-user-name, docker-password, image-url (optional)
permissions:
id-token: write
contents: read
name: Aerospike Go Client Tests
"on":
push:
pull_request:
workflow_dispatch:
inputs:
server-config-json:
description: 'Server configuration JSON template (use {{SECRET_NAME}} placeholders). Leave empty for default.'
required: false
type: string
default: ''
env:
AEROSPIKE_HOSTS: "127.0.0.1:3000"
GODEBUG: fips140=only
GOFIPS140: latest
jobs:
setup:
runs-on: ubuntu-latest
outputs:
servers: ${{ steps.set-servers.outputs.servers }}
go-version: ${{ steps.get-go-version.outputs.go-version }}
steps:
- uses: actions/checkout@v4
- name: Get Go version
id: get-go-version
run: |
GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
echo "go-version=${GO_VERSION}" >> $GITHUB_OUTPUT
- name: Get server list
id: set-servers
run: |
# Read server names from config file (or use default)
if [ -f ".github/server-matrix.json" ]; then
SERVERS=$(jq -r 'keys | @json' .github/server-matrix.json)
else
SERVERS='["stable","release","8.1.1-pr"]'
fi
echo "servers=${SERVERS}" >> $GITHUB_OUTPUT
echo "Server list: ${SERVERS}"
build:
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
server: ${{ fromJson(needs.setup.outputs.servers) }}
steps:
- uses: actions/checkout@v4
- name: Load server configuration
id: load-config
env:
DOCKER_USERNAME: ${{ secrets.TEST_DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.TEST_DOCKER_PASSWORD }}
DOCKER_URL: ${{ secrets.TEST_DOCKER_URL }}
SERVER: ${{ matrix.server }}
run: |
# Load configuration for this server
if [ -f ".github/server-matrix.json" ]; then
CONFIG=$(jq -r --arg server "$SERVER" '.[$server]' .github/server-matrix.json)
else
echo "ERROR: server-matrix.json not found"
exit 1
fi
# Replace placeholders with secrets
CONFIG=$(echo "$CONFIG" | jq \
--arg docker_user "${DOCKER_USERNAME:-}" \
--arg docker_pass "${DOCKER_PASSWORD:-}" \
--arg docker_url "${DOCKER_URL:-}" \
'walk(
if type == "string" then
. | gsub("\\{\\{DOCKER_USERNAME\\}}"; $docker_user)
| gsub("\\{\\{DOCKER_PASSWORD\\}}"; $docker_pass)
| gsub("\\{\\{DOCKER_URL\\}}"; $docker_url)
else
.
end
)')
# Extract values
VERSION=$(echo "$CONFIG" | jq -r '.version')
DOCKER_USER=$(echo "$CONFIG" | jq -r '."docker-user-name" // ""')
DOCKER_PASS=$(echo "$CONFIG" | jq -r '."docker-password" // ""')
IMAGE_URL=$(echo "$CONFIG" | jq -r '."image-url" // "aerospike.jfrog.io/docker/"')
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "docker-user=${DOCKER_USER}" >> $GITHUB_OUTPUT
echo "docker-pass=${DOCKER_PASS}" >> $GITHUB_OUTPUT
echo "image-url=${IMAGE_URL}" >> $GITHUB_OUTPUT
echo "Loaded config for ${SERVER}: version=${VERSION}"
- name: "Setup Go"
uses: actions/setup-go@v4
with:
go-version: "${{ needs.setup.outputs.go-version }}"
cache: true
- name: Fetch dependencies
env:
GODEBUG: fips140=on
run: |
# Install all dependencies
go mod download
# Install ginkgo CLI and gocovmerge for testing
go install github.com/onsi/ginkgo/v2/[email protected]
go mod download github.com/wadey/gocovmerge
# Vendor the dependencies
go mod vendor
- name: Display Go version
run: go version
- name: Set up Aerospike Database
uses: ./.github/actions/run-ee-server
with:
server-tag: ${{ steps.load-config.outputs.version }}
docker-hub-username: ${{ steps.load-config.outputs.docker-user }}
docker-hub-password: ${{ steps.load-config.outputs.docker-pass }}
container-repo-url: ${{ steps.load-config.outputs.image-url }}
# oidc-provider: ${{ secrets.JFROG_OIDC_PROVIDER || 'github-aerospike' }}
# oidc-audience: ${{ secrets.JFROG_OIDC_AUDIENCE || 'jfrog-aerospike' }}
oidc-provider: "database-gh-areospike"
oidc-audience: "database-gh-areospike"
- name: Test Lua Code
env: {GOPROXY: off, GOSUMDB: off, GOFLAGS: -mod=vendor}
run: go run -mod=vendor github.com/onsi/ginkgo/v2/ginkgo -cover -race -r -keep-going -succinct -randomize-suites internal/lua
- name: Test types package
env: {GOPROXY: off, GOSUMDB: off, GOFLAGS: -mod=vendor}
run: go run -mod=vendor github.com/onsi/ginkgo/v2/ginkgo -cover -race -r -keep-going -succinct -randomize-suites types
- name: Test pkg tests
env: {GOPROXY: off, GOSUMDB: off, GOFLAGS: -mod=vendor}
run: go run -mod=vendor github.com/onsi/ginkgo/v2/ginkgo -cover -race -r -keep-going -succinct -randomize-suites pkg
- name: Build Benchmark tool
env: {GOPROXY: off, GOSUMDB: off, GOFLAGS: -mod=vendor}
run: cd tools/benchmark | go build -mod=vendor -tags as_proxy -o benchmark .
- name: Build asinfo tool
env: {GOPROXY: off, GOSUMDB: off, GOFLAGS: -mod=vendor}
run: cd tools/asinfo | go build -mod=vendor -o asinfo .
- name: Build cli tool
env: {GOPROXY: off, GOSUMDB: off, GOFLAGS: -mod=vendor}
run: cd tools/cli | go build -mod=vendor -o cli .
- name: Build example files
env: {GOPROXY: off, GOSUMDB: off, GOFLAGS: -mod=vendor}
run: find examples -name "*.go" -type f -print0 | xargs -0 -n1 go build
- name: Build with Reflection code removed
env: {GOPROXY: off, GOSUMDB: off, GOFLAGS: -mod=vendor}
run: go run -mod=vendor github.com/onsi/ginkgo/v2/ginkgo build -tags="as_performance" .
- name: Build for Google App Engine (unsafe package removed)
env: {GOPROXY: off, GOSUMDB: off, GOFLAGS: -mod=vendor}
run: go run -mod=vendor github.com/onsi/ginkgo/v2/ginkgo build -tags="app_engine" .
- name: Run the tests
env: {GOPROXY: off, GOSUMDB: off, GOFLAGS: -mod=vendor}
run: go run -mod=vendor github.com/onsi/ginkgo/v2/ginkgo -coverprofile=./cover_native.out -covermode=atomic -coverpkg=./... -race -keep-going -succinct -randomize-suites -skip="HyperLogLog"
- name: Combine Cover Profiles
env: {GOPROXY: off, GOSUMDB: off, GOFLAGS: -mod=vendor}
run: go run -mod=vendor github.com/wadey/gocovmerge cover_*.out > cover_all.out
- name: Check Code Coverage
uses: vladopajic/go-test-coverage@v2
with:
# Configure action using config file (option 1)
config: ./.testcoverage.yml