Skip to content

Modified submodule to declare global in header file. #36

Modified submodule to declare global in header file.

Modified submodule to declare global in header file. #36

name: 'Test Dev Artifacts'
run-name: 'Build wheels (nodejs-tags=${{ inputs.nodejs-tags }}, platform-tag=${{ inputs.platform-tag }}, run_tests=${{ inputs.run_tests }}, use-server-rc=${{ inputs.use-server-rc }}, server-tag=${{ inputs.server-tag }})'
# Build wheels on all (or select) Python versions supported by the Python client for a specific platform
permissions:
# This is required for requesting the OIDC token
id-token: write
contents: read
on:
workflow_dispatch:
inputs:
# These are the usual cases for building wheels:
#
# 1. One wheel for *one* supported Python version. This is for running specialized tests that only need one Python version
# like valgrind or a failing QE test. And usually, we only need one wheel for debugging purposes.
# 2. Wheels for *all* supported Python versions for *one* supported platform. This is useful for testing workflow changes for a
# single OS or CPU architecture (e.g testing that changes to debugging modes work on all Python versions)
# 3. Wheels for *all* supported Python versions and *all* supported platforms. This is for building wheels for different
# CI/CD stages (e.g dev, stage, or master). We can also test debugging modes for all platforms that support them
#
# We're able to combine case 1 and 2 into one workflow by creating an input that takes in a JSON list of strings (Python tags)
# to build wheels for. Actual list inputs aren't supported yet, so it's actually a JSON list encoded as a string.
#
# However, it's harder to combine this workflow (case 1 + 2) with case 3, because matrix outputs don't exist yet
# in Github Actions. So all jobs in the cibuildwheel job would have to pass for a self hosted job to run.
# We want each platform to be tested independently of each other,
# so there is a wrapper workflow that has a list of platforms to test and reuses this workflow for each platform.
# If one platform fails, it will not affect the building and testing of another platform (we disable fail fast mode)
nodejs-tags:
type: string
description: Valid JSON list of Python tags to build the client for
required: false
default: '[["v115", "20"], ["v127", "22"], ["v137", "24"]]'
platform-tag:
description: Platform to build the client for.
type: choice
required: true
options:
- manylinux_x86_64
- manylinux_aarch64
- macosx_x86_64
- macosx_arm64
- win_amd64
# Makes debugging via gh cli easier.
default: manylinux_x86_64
version:
type: string
description: Build version
required: true
run_tests:
description: 'Run Aerospike server and run tests using built wheels?'
type: boolean
required: false
default: true
use-server-rc:
type: boolean
required: true
default: false
description: 'Test against server release candidate?'
server-tag:
required: true
default: '8.1.0.0-rc5'
description: 'Server docker image tag'
test-file:
required: false
default: ''
description: 'new_tests/<value>'
workflow_call:
inputs:
# See workflow call hack in update-version.yml
is_workflow_call:
type: boolean
default: true
required: false
nodejs-tags:
type: string
required: false
default: '[["v115", "20"], ["v127", "22"], ["v137", "24"]]'
platform-tag:
type: string
required: true
version:
type: string
description: Build version
required: true
run_tests:
type: boolean
required: false
default: true
use-server-rc:
required: false
type: boolean
default: false
description: 'Test against server release candidate?'
server-tag:
required: false
type: string
default: '8.1.0.0-rc5'
description: 'Server docker image tag'
test-file:
required: false
type: string
default: ''
secrets:
# Just make all the secrets required to make things simpler...
DOCKER_HUB_BOT_USERNAME:
required: true
DOCKER_HUB_BOT_PW:
required: true
MAC_M1_SELF_HOSTED_RUNNER_PW:
required: true
jobs:
# Maps don't exist in Github Actions, so we have to store the map using a script and fetch it in a job
# This uses up more billing minutes (rounded up to 1 minute for each job run),
# but this should be ok based on the minutes usage data for the aerospike organization
get-runner-os:
outputs:
runner-os: ${{ steps.get-runner-os.outputs.runner_os }}
runs-on: ubuntu-22.04
steps:
- id: get-runner-os
# Single source of truth for which runner OS to use for each platform tag
run: |
declare -A hashmap
hashmap[manylinux_x86_64]="ubuntu-22.04"
hashmap[manylinux_aarch64]="ubuntu-22.04-arm"
hashmap[macosx_x86_64]="macos-13-large"
hashmap[macosx_arm64]="SMA2"
hashmap[win_amd64]="windows-2022"
echo runner_os=${hashmap[${{ inputs.platform-tag }}]} >> $GITHUB_OUTPUT
# Bash >= 4 supports hashmaps
shell: bash
test-ee:
needs: get-runner-os
if: ${{ inputs.run_tests && (inputs.platform-tag != 'win_amd64') }}
strategy:
matrix:
nodejs-tag: ${{ fromJSON(inputs.nodejs-tags) }}
fail-fast: false
runs-on: ${{ needs.get-runner-os.outputs.runner-os }}
env:
BUILD_IDENTIFIER: "${{ matrix.nodejs-tag[0] }}-${{ inputs.platform-tag }}"
MACOS_OPENSSL_VERSION: 3
steps:
# REUSABLE PART
- name: Create status check message
run: echo STATUS_CHECK_MESSAGE="test-ee (${{ env.BUILD_IDENTIFIER }})" >> $GITHUB_ENV
shell: bash
- name: Show job status for commit
uses: myrotvorets/[email protected]
if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
- uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# We need the last tag before the ref, so we can relabel the version if needed
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.nodejs-tag[1] }}
- name: 'Windows: Install C client deps'
if: ${{ inputs.platform-tag == 'win_amd64' }}
run: nuget restore
working-directory: aerospike-client-c/vs
- name: 'macOS x86: Setup Docker using colima for testing'
if: ${{ inputs.platform-tag == 'macosx_x86_64' }}
uses: ./.github/actions/setup-docker-on-macos
- name: 'macOS x86: run Aerospike server in Docker container and connect via localhost'
if: ${{ inputs.platform-tag == 'macosx_x86_64' }}
uses: ./.github/actions/run-ee-server-for-ext-container
with:
use-server-rc: ${{ inputs.use-server-rc }}
server-tag: ${{ inputs.server-tag }}
docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}
- name: Remove aerospike docker image
if: ${{ inputs.platform-tag == 'manylinux_aarch64' }}
run: |
if docker ps -aq | grep -q .; then
docker rm -f $(docker ps -aq) || echo "Failed to remove one or more containers."
else
echo "No containers to remove."
fi
# TODO: combine this composite action and the above into one
- name: "Linux: run Aerospike server in Docker container and configure config.conf to connect to the server container's Docker IP address"
if: ${{ inputs.platform-tag == 'manylinux_x86_64' || inputs.platform-tag == 'manylinux_aarch64' }}
uses: ./.github/actions/run-ee-server-for-ext-container
with:
use-server-rc: ${{ inputs.use-server-rc }}
server-tag: ${{ inputs.server-tag }}
docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}
# FIND NO SERVER TESTS AND RUN THEM
#
#- name: If not running tests against server, only run basic import test
# if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'false' }}
# # Use double quotes otherwise Windows will throw this error in cibuildwheel
# # 'import
# # ^
# # SyntaxError: EOL while scanning string literal
# run: echo "TEST_COMMAND=python -c \"import aerospike\"" >> $GITHUB_ENV
# shell: bash
#- name: Otherwise, enable integration tests
# if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'true' }}
# run: echo "TEST_COMMAND=cd ts-test;
# npm install typescript --save-dev;
# npx tsc;
# cd ..;
# npm run test dist/ -- --h 127.0.0.1 --port 3000" >> $GITHUB_ENV
# shell: bash
- name: Set up JFrog credentials
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: https://aerospike.jfrog.io
with:
oidc-provider-name: gh-aerospike-clients
oidc-audience: aerospike/clients
- name: Download Artifacts from Jfrog
run: jf rt dl "clients-npm-dev-local/aerospike/${{ env.NEW_VERSION }}/" "downloaded-artifacts/"
env:
NEW_VERSION: ${{ inputs.version }}
PACKAGE_MANAGER: npm
- name: list Artifacts
run: |
ls downloaded-artifacts
ls downloaded-artifacts/aerospike
ls downloaded-artifacts/aerospike/${{ env.NEW_VERSION }}
env:
NEW_VERSION: ${{ inputs.version }}
- name: Move artifacts
run: |
tar --strip-components=1 -xvf aerospike-${{ env.NEW_VERSION }}.tgz
env:
NEW_VERSION: ${{ inputs.version }}
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: check binding
run:
ls lib/binding;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Change install command for release
run: node ./scripts/change-install-command.js
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Run tests
if: ${{ inputs.run_tests && startsWith(inputs.platform-tag, 'manylinux')}}
run: |
docker ps;
docker logs aerospike;
cd ts-test;
npm install;
npx tsc;
cd ..;
rm -rf ts-test/dist;
npx tsc;
npm run test -- --t 40000 --h 127.0.0.1 --port 3000 --U superuser --P superuser;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Run tests
if: ${{ inputs.run_tests && inputs.platform-tag == 'macosx_x86_64'}}
run: |
docker ps;
docker logs aerospike;
cd ts-test;
npm install;
npx tsc;
cd ..;
npx tsc;
npm run test -- --t 40000 --h 127.0.0.1 --port 3000 --U superuser --P superuser;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
#- name: Debug server
# run: |
# docker ps;
# docker logs aerospike;
- name: Set final commit status
uses: myrotvorets/[email protected]
if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
status: ${{ job.status }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
# test-prefer-rack:
# needs: get-runner-os
# if: ${{ inputs.run_tests && (inputs.platform-tag == 'manylinux_x86_64') }}
# strategy:
# matrix:
# nodejs-tag: ${{ fromJSON(inputs.nodejs-tags) }}
# fail-fast: false
# runs-on: ${{ needs.get-runner-os.outputs.runner-os }}
# env:
# BUILD_IDENTIFIER: "${{ matrix.nodejs-tag[0] }}-${{ inputs.platform-tag }}"
# MACOS_OPENSSL_VERSION: 3
# steps:
#
# # REUSABLE PART
# - name: Create status check message
# run: echo STATUS_CHECK_MESSAGE="test-ee (${{ env.BUILD_IDENTIFIER }})" >> $GITHUB_ENV
# shell: bash
#
# - name: Show job status for commit
# uses: myrotvorets/[email protected]
# if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
# with:
# sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# context: ${{ env.STATUS_CHECK_MESSAGE }}
#
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# ref: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# # We need the last tag before the ref, so we can relabel the version if needed
# fetch-depth: 0
#
# - uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.nodejs-tag[1] }}
#
# - name: Download Aerolab zip
# run: |
# curl -L -o aerolab.zip https://github.com/aerospike/aerolab/releases/download/7.8.0/aerolab-linux-amd64-7.8.0.zip
#
# - name: Unzip Aerolab binary
# run: |
# unzip aerolab.zip
# chmod +x aerolab
#
# - name: Move binary to /usr/local/bin
# run: sudo mv aerolab /usr/local/bin/
#
# - name: Verify installation
# run: aerolab version
#
# - name: Configure Aerolab backend
# run: aerolab config backend -t docker
#
#
# - name: Retrieve the secret and decode it to a file
# env:
# FEATURE_FILE: ${{ secrets.FEATURE_FILE }}
# run: |
# echo $FEATURE_FILE | base64 --decode > features.conf
# working-directory: ts-test
#
# - name: Create cluster
# run: sh scripts/three_node.sh
# working-directory: ts-test
#
# - name: list cluster
# run: aerolab cluster list
#
# - name: Set up JFrog credentials
# uses: jfrog/setup-jfrog-cli@v4
# env:
# JF_URL: https://aerospike.jfrog.io
# with:
# oidc-provider-name: gh-aerospike-clients
# oidc-audience: aerospike/clients
#
# - name: Download Artifacts from Jfrog
# run: jf rt dl "clients-npm-dev-local/aerospike/${{ env.NEW_VERSION }}/" "downloaded-artifacts/"
# env:
# NEW_VERSION: ${{ inputs.version }}
# PACKAGE_MANAGER: npm
#
# - name: list Artifacts
# run: |
# ls downloaded-artifacts
# ls downloaded-artifacts/aerospike
# ls downloaded-artifacts/aerospike/${{ env.NEW_VERSION }}
# env:
# NEW_VERSION: ${{ inputs.version }}
#
# - name: Move artifacts
# run: |
# tar --strip-components=1 -xvf aerospike-${{ env.NEW_VERSION }}.tgz
# env:
# NEW_VERSION: ${{ inputs.version }}
# working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
#
# - name: check binding
# run:
# ls lib/binding;
# working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
#
# - name: Change install command for release
# run: node ./scripts/change-install-command.js
# working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
#
# - name: add in debug string for test
# run: |
# awk 'NR==613{print "\t\tprintf(\"Node=%s\\n\", as_node_get_address_string(cmd->node));"}1' aerospike-client-c/src/main/aerospike/as_event.c > temp && mv temp aerospike-client-c/src/main/aerospike/as_event.c
# working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
#
# - name: Run tests
# if: ${{ inputs.run_tests && startsWith(inputs.platform-tag, 'manylinux')}}
# run: |
# docker ps;
# cd ts-test;
# npm install;
# npx tsc;
# cd ..;
# npx tsc;
# npm run test --testfile=prefer_rack.js -- --testPreferRack true --h 0.0.0.0 --port 3100 --t 40000;
# npm run test --testfile=metrics_key_busy.js -- --testMetricsKeyBusy true --h 0.0.0.0 --port 3100 --t 40000;
# working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
#
# - name: Destroy cluster 1
# run: echo y | aerolab cluster destroy
#
# - name: Set final commit status
# uses: myrotvorets/[email protected]
# if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }}
# with:
# sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# status: ${{ job.status }}
# context: ${{ env.STATUS_CHECK_MESSAGE }}
test-set-xdr-filter:
needs: get-runner-os
if: ${{ inputs.run_tests && (inputs.platform-tag == 'manylinux_x86_64') }}
strategy:
matrix:
nodejs-tag: ${{ fromJSON(inputs.nodejs-tags) }}
fail-fast: false
runs-on: ${{ needs.get-runner-os.outputs.runner-os }}
env:
BUILD_IDENTIFIER: "${{ matrix.nodejs-tag[0] }}-${{ inputs.platform-tag }}"
MACOS_OPENSSL_VERSION: 3
steps:
# REUSABLE PART
- name: Create status check message
run: echo STATUS_CHECK_MESSAGE="test-ee (${{ env.BUILD_IDENTIFIER }})" >> $GITHUB_ENV
shell: bash
- name: Show job status for commit
uses: myrotvorets/[email protected]
if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
- uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# We need the last tag before the ref, so we can relabel the version if needed
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.nodejs-tag[1] }}
- name: Download Aerolab zip
run: |
curl -L -o aerolab.zip https://github.com/aerospike/aerolab/releases/download/7.8.0/aerolab-linux-amd64-7.8.0.zip
- name: Unzip Aerolab binary
run: |
unzip aerolab.zip
chmod +x aerolab
- name: Move binary to /usr/local/bin
run: sudo mv aerolab /usr/local/bin/
- name: Verify installation
run: aerolab version
- name: Configure Aerolab backend
run: aerolab config backend -t docker
- name: Create cluster
run: aerolab xdr create-clusters -n dc1 -c 3 -N dc2 -C 3 -M test
- name: list cluster
run: aerolab cluster list
- name: Set up JFrog credentials
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: https://aerospike.jfrog.io
with:
oidc-provider-name: gh-aerospike-clients
oidc-audience: aerospike/clients
- name: Download Artifacts from Jfrog
run: jf rt dl "clients-npm-dev-local/aerospike/${{ env.NEW_VERSION }}/" "downloaded-artifacts/"
env:
NEW_VERSION: ${{ inputs.version }}
PACKAGE_MANAGER: npm
- name: list Artifacts
run: |
ls downloaded-artifacts
ls downloaded-artifacts/aerospike
ls downloaded-artifacts/aerospike/${{ env.NEW_VERSION }}
env:
NEW_VERSION: ${{ inputs.version }}
- name: Move artifacts
run: |
tar --strip-components=1 -xvf aerospike-${{ env.NEW_VERSION }}.tgz
env:
NEW_VERSION: ${{ inputs.version }}
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: check binding
run:
ls lib/binding;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Change install command for release
run: node ./scripts/change-install-command.js
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Run tests
if: ${{ inputs.run_tests && startsWith(inputs.platform-tag, 'manylinux') }}
run: |
docker ps;
cd ts-test;
npm install;
npx tsc;
cd ..;
npx tsc;
npm run test --testfile=set_xdr_filter.js -- --testXDR true --h 172.17.0.2 --port 3100;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Destroy cluster 1
run: echo y | aerolab cluster destroy --name dc1
- name: Destroy cluster 2
run: echo y | aerolab cluster destroy --name dc2
- name: Set final commit status
uses: myrotvorets/[email protected]
if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
status: ${{ job.status }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
test-valgrind:
needs: get-runner-os
strategy:
matrix:
nodejs-tag: ${{ fromJSON(inputs.nodejs-tags) }}
fail-fast: false
if: ${{ inputs.platform-tag == 'manylinux_x86_64' }}
runs-on: ${{ needs.get-runner-os.outputs.runner-os }}
env:
BUILD_IDENTIFIER: "${{ matrix.nodejs-tag[0] }}-${{ inputs.platform-tag }}"
MACOS_OPENSSL_VERSION: 3
steps:
# REUSABLE PART
- name: Create status check message
run: echo STATUS_CHECK_MESSAGE="test-ee (${{ env.BUILD_IDENTIFIER }})" >> $GITHUB_ENV
shell: bash
- name: Show job status for commit
uses: myrotvorets/[email protected]
if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
- uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# We need the last tag before the ref, so we can relabel the version if needed
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.nodejs-tag[1] }}
- name: 'Windows: Install C client deps'
if: ${{ inputs.platform-tag == 'win_amd64' }}
run: nuget restore
working-directory: aerospike-client-c/vs
- name: 'macOS x86: Setup Docker using colima for testing'
if: ${{ inputs.platform-tag == 'macosx_x86_64' }}
uses: ./.github/actions/setup-docker-on-macos
- name: 'macOS x86: run Aerospike server in Docker container and connect via localhost'
if: ${{ inputs.platform-tag == 'macosx_x86_64' }}
uses: ./.github/actions/run-ee-server-for-ext-container
with:
use-server-rc: ${{ inputs.use-server-rc }}
server-tag: ${{ inputs.server-tag }}
docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}
- name: Remove aerospike docker image
if: ${{ inputs.platform-tag == 'manylinux_aarch64' }}
run: |
if docker ps -aq | grep -q .; then
docker rm -f $(docker ps -aq) || echo "Failed to remove one or more containers."
else
echo "No containers to remove."
fi
# TODO: combine this composite action and the above into one
- name: "Linux: run Aerospike server in Docker container and configure config.conf to connect to the server container's Docker IP address"
if: ${{ inputs.platform-tag == 'manylinux_x86_64' || inputs.platform-tag == 'manylinux_aarch64' }}
uses: ./.github/actions/run-ee-server-for-ext-container
with:
use-server-rc: ${{ inputs.use-server-rc }}
server-tag: ${{ inputs.server-tag }}
docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}
# FIND NO SERVER TESTS AND RUN THEM
#
#- name: If not running tests against server, only run basic import test
# if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'false' }}
# # Use double quotes otherwise Windows will throw this error in cibuildwheel
# # 'import
# # ^
# # SyntaxError: EOL while scanning string literal
# run: echo "TEST_COMMAND=python -c \"import aerospike\"" >> $GITHUB_ENV
# shell: bash
#- name: Otherwise, enable integration tests
# if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'true' }}
# run: echo "TEST_COMMAND=cd ts-test;
# npm install typescript --save-dev;
# npx tsc;
# cd ..;
# npm run test dist/ -- --h 127.0.0.1 --port 3000" >> $GITHUB_ENV
# shell: bash
- name: Set up JFrog credentials
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: https://aerospike.jfrog.io
with:
oidc-provider-name: gh-aerospike-clients
oidc-audience: aerospike/clients
- name: Download Artifacts from Jfrog
run: jf rt dl "clients-npm-dev-local/aerospike/${{ env.NEW_VERSION }}/" "downloaded-artifacts/"
env:
NEW_VERSION: ${{ inputs.version }}
PACKAGE_MANAGER: npm
- name: list Artifacts
run: |
ls downloaded-artifacts
ls downloaded-artifacts/aerospike
ls downloaded-artifacts/aerospike/${{ env.NEW_VERSION }}
env:
NEW_VERSION: ${{ inputs.version }}
- name: Move artifacts
run: |
tar --strip-components=1 -xvf aerospike-${{ env.NEW_VERSION }}.tgz
env:
NEW_VERSION: ${{ inputs.version }}
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: check binding
run:
ls lib/binding;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Change install command for release
run: node ./scripts/change-install-command.js
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: install valgrind
run: |
sudo apt-get update;
sudo apt update;
sudo apt install valgrind;
- name: Install pre-reqs
if: ${{ inputs.run_tests && startsWith(inputs.platform-tag, 'manylinux') }}
run: |
cd ts-test;
npm install;
npx tsc;
cp tests/udf.lua dist/udf.lua;
cd ..;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Run Valgrind
run: |
docker ps;
npx tsc;
npm run valgrind -- --t 40000 --h 127.0.0.1 --port 3000 --U superuser --P superuser;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Set final commit status
uses: myrotvorets/[email protected]
if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
status: ${{ job.status }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
test-tsc-compile:
needs: get-runner-os
if: ${{ inputs.run_tests && (inputs.platform-tag != 'win_amd64') }}
strategy:
matrix:
nodejs-tag: ${{ fromJSON(inputs.nodejs-tags) }}
fail-fast: false
runs-on: ${{ needs.get-runner-os.outputs.runner-os }}
env:
BUILD_IDENTIFIER: "${{ matrix.nodejs-tag[0] }}-${{ inputs.platform-tag }}"
MACOS_OPENSSL_VERSION: 3
steps:
# REUSABLE PART
- name: Create status check message
run: echo STATUS_CHECK_MESSAGE="test-ee (${{ env.BUILD_IDENTIFIER }})" >> $GITHUB_ENV
shell: bash
- name: Show job status for commit
uses: myrotvorets/[email protected]
if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
- uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# We need the last tag before the ref, so we can relabel the version if needed
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.nodejs-tag[1] }}
# FIND NO SERVER TESTS AND RUN THEM
#
#- name: If not running tests against server, only run basic import test
# if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'false' }}
# # Use double quotes otherwise Windows will throw this error in cibuildwheel
# # 'import
# # ^
# # SyntaxError: EOL while scanning string literal
# run: echo "TEST_COMMAND=python -c \"import aerospike\"" >> $GITHUB_ENV
# shell: bash
#- name: Otherwise, enable integration tests
# if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'true' }}
# run: echo "TEST_COMMAND=cd ts-test;
# npm install typescript --save-dev;
# npx tsc;
# cd ..;
# npm run test dist/ -- --h 127.0.0.1 --port 3000" >> $GITHUB_ENV
# shell: bash
- name: Set up JFrog credentials
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: https://aerospike.jfrog.io
with:
oidc-provider-name: gh-aerospike-clients
oidc-audience: aerospike/clients
- name: Download Artifacts from Jfrog
run: jf rt dl "clients-npm-dev-local/aerospike/${{ env.NEW_VERSION }}/" "downloaded-artifacts/"
env:
NEW_VERSION: ${{ inputs.version }}
PACKAGE_MANAGER: npm
- name: list Artifacts
run: |
ls downloaded-artifacts
ls downloaded-artifacts/aerospike
ls downloaded-artifacts/aerospike/${{ env.NEW_VERSION }}
env:
NEW_VERSION: ${{ inputs.version }}
- name: Move artifacts
run: |
tar --strip-components=1 -xvf aerospike-${{ env.NEW_VERSION }}.tgz
env:
NEW_VERSION: ${{ inputs.version }}
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: check binding
run:
ls lib/binding;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Change install command for release
run: node ./scripts/change-install-command.js
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Run tests
if: ${{ inputs.run_tests && startsWith(inputs.platform-tag, 'manylinux') }}
run: |
cd ts-test;
npm install;
npx tsc;
cd ..;
npx tsc;
npx tsc typings/index.d.ts;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Run tests
if: ${{ inputs.run_tests && inputs.platform-tag == 'macosx_x86_64'}}
run: |
cd ts-test;
npm install;
npx tsc;
cd ..;
npx tsc;
npx tsc typings/index.d.ts;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Set final commit status
uses: myrotvorets/[email protected]
if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
status: ${{ job.status }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
test-metrics:
needs: get-runner-os
strategy:
matrix:
nodejs-tag: ${{ fromJSON(inputs.nodejs-tags) }}
fail-fast: false
runs-on: ${{ needs.get-runner-os.outputs.runner-os }}
if: ${{ inputs.run_tests && ( inputs.platform-tag != 'macosx_x86_64' ) }}
env:
BUILD_IDENTIFIER: "${{ matrix.nodejs-tag[0] }}-${{ inputs.platform-tag }}"
MACOS_OPENSSL_VERSION: 3
steps:
# REUSABLE PART
- name: Create status check message
run: echo STATUS_CHECK_MESSAGE="test-ee (${{ env.BUILD_IDENTIFIER }})" >> $GITHUB_ENV
shell: bash
- name: Show job status for commit
uses: myrotvorets/[email protected]
if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
- uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# We need the last tag before the ref, so we can relabel the version if needed
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.nodejs-tag[1] }}
- name: Set up JFrog credentials
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: https://aerospike.jfrog.io
with:
oidc-provider-name: gh-aerospike-clients
oidc-audience: aerospike/clients
- name: Download Artifacts from Jfrog
run: jf rt dl "clients-npm-dev-local/aerospike/${{ env.NEW_VERSION }}/" "downloaded-artifacts/"
env:
NEW_VERSION: ${{ inputs.version }}
PACKAGE_MANAGER: npm
- name: list Artifacts
run: |
ls downloaded-artifacts
ls downloaded-artifacts/aerospike
ls downloaded-artifacts/aerospike/${{ env.NEW_VERSION }}
env:
NEW_VERSION: ${{ inputs.version }}
- name: Move artifacts
run: |
tar --strip-components=1 -xvf aerospike-${{ env.NEW_VERSION }}.tgz
env:
NEW_VERSION: ${{ inputs.version }}
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: check binding
run:
ls lib/binding;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Change install command for release
run: node ./scripts/change-install-command.js
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: 'macOS x86: Setup Docker using colima for testing'
if: ${{ inputs.platform-tag == 'macosx_x86_64' }}
uses: ./.github/actions/setup-docker-on-macos
- name: Run tests
if: ${{ inputs.run_tests && startsWith(inputs.platform-tag, 'manylinux') }}
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
run: |
docker ps;
cd ts-test;
npm install;
npx tsc;
cd ..;
npx tsc;
docker pull aerospike/aerospike-server:latest;
npm run test --testfile=metrics_node_close.js -- --testMetrics true --h localhost --port 3000 --t 50000;
npm run test --testfile=metrics_cluster_name.js -- --testMetrics true --h localhost --port 3000 --t 50000;
- name: Run tests
if: ${{ inputs.run_tests && inputs.platform-tag == 'macosx_x86_64'}}
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
run: |
docker ps;
cd ts-test;
npm install;
npx tsc;
cd ..;
npx tsc;
docker pull aerospike/aerospike-server:latest;
npm run test --testfile=metrics_node_close.js -- --testMetrics true --h localhost --port 3000 --t 50000;
npm run test --testfile=metrics_cluster_name.js -- --testMetrics true --h localhost --port 3000 --t 50000;
- name: Set final commit status
uses: myrotvorets/[email protected]
if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
status: ${{ job.status }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
test-ce:
needs: get-runner-os
strategy:
matrix:
nodejs-tag: ${{ fromJSON(inputs.nodejs-tags) }}
fail-fast: false
if: ${{ inputs.run_tests && (inputs.platform-tag != 'win_amd64' && inputs.platform-tag != 'macosx_x86_64') }}
runs-on: ${{ needs.get-runner-os.outputs.runner-os }}
env:
BUILD_IDENTIFIER: "${{ matrix.nodejs-tag[0] }}-${{ inputs.platform-tag }}"
MACOS_OPENSSL_VERSION: 3
steps:
# REUSABLE PART
- name: Create status check message
run: echo STATUS_CHECK_MESSAGE="test-ce (${{ env.BUILD_IDENTIFIER }})" >> $GITHUB_ENV
shell: bash
- name: Show job status for commit
uses: myrotvorets/[email protected]
if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
- uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# We need the last tag before the ref, so we can relabel the version if needed
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.nodejs-tag[1] }}
- name: Run latest Community edition Aerospike server
if: ${{ inputs.run_tests && startsWith(inputs.platform-tag, 'manylinux') }}
run: docker run -d --name aerospike -e DEFAULT_TTL=2592000 -p 3000-3002:3000-3002 aerospike/aerospike-server:8.1.0.0-rc5
- uses: ./.github/actions/wait-for-as-server-to-start
with:
container-name: aerospike
- name: Set up JFrog credentials
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: https://aerospike.jfrog.io
with:
oidc-provider-name: gh-aerospike-clients
oidc-audience: aerospike/clients
- name: Download Artifacts from Jfrog
run: jf rt dl "clients-npm-dev-local/aerospike/${{ env.NEW_VERSION }}/" "downloaded-artifacts/"
env:
NEW_VERSION: ${{ inputs.version }}
PACKAGE_MANAGER: npm
- name: list Artifacts
run: |
ls downloaded-artifacts
ls downloaded-artifacts/aerospike
ls downloaded-artifacts/aerospike/${{ env.NEW_VERSION }}
env:
NEW_VERSION: ${{ inputs.version }}
- name: Move artifacts
run: |
tar --strip-components=1 -xvf aerospike-${{ env.NEW_VERSION }}.tgz
env:
NEW_VERSION: ${{ inputs.version }}
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: check binding
run:
ls lib/binding;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Change install command for release
run: node ./scripts/change-install-command.js
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Run tests
if: ${{ inputs.run_tests && startsWith(inputs.platform-tag, 'manylinux') }}
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
run: |
docker ps;
docker logs aerospike;
cd ts-test;
npm install;
npx tsc;
cd ..;
npx tsc;
npm run test dist/${{ inputs.test-file }} -- --h localhost --port 3000;
- name: Set final commit status
uses: myrotvorets/[email protected]
if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
status: ${{ job.status }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
# test-lowest-supported-server:
# needs: get-runner-os
# strategy:
# matrix:
# nodejs-tag: ${{ fromJSON(inputs.nodejs-tags) }}
# fail-fast: false
# #if: ${{ inputs.platform-tag == 'manylinux_x86_64' }}
# runs-on: ${{ needs.get-runner-os.outputs.runner-os }}
# env:
# BUILD_IDENTIFIER: "${{ matrix.nodejs-tag[0] }}-${{ inputs.platform-tag }}"
# MACOS_OPENSSL_VERSION: 3
# steps:
#
# # REUSABLE PART
# - name: Create status check message
# run: echo STATUS_CHECK_MESSAGE="test-lowest-supported-server (${{ env.BUILD_IDENTIFIER }})" >> $GITHUB_ENV
# shell: bash
#
# - name: Show job status for commit
# uses: myrotvorets/[email protected]
# if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
# with:
# sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# context: ${{ env.STATUS_CHECK_MESSAGE }}
#
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# ref: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# # We need the last tag before the ref, so we can relabel the version if needed
# fetch-depth: 0
#
# - uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.nodejs-tag[1] }}
#
# - name: Remove aerospike docker image
# if: ${{ inputs.platform-tag == 'manylinux_aarch64' }}
# run: |
# if docker ps -aq | grep -q .; then
# docker rm -f $(docker ps -aq) || echo "Failed to remove one or more containers."
# else
# echo "No containers to remove."
# fi
#
# - name: Run lowest supported server
# run: |
# SERVER_VERSION=$(curl -s "https://registry.hub.docker.com/v2/repositories/aerospike/aerospike-server/tags?page_size=100" | jq '.results[] | select(.name | startswith("6.1")).name' -r | head -n 1)
# docker run -d --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server:$SERVER_VERSION
#
# # FIND NO SERVER TESTS AND RUN THEM
# #
# #- name: If not running tests against server, only run basic import test
# # if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'false' }}
# # # Use double quotes otherwise Windows will throw this error in cibuildwheel
# # # 'import
# # # ^
# # # SyntaxError: EOL while scanning string literal
# # run: echo "TEST_COMMAND=python -c \"import aerospike\"" >> $GITHUB_ENV
# # shell: bash
#
# #- name: Otherwise, enable integration tests
# # if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'true' }}
# # run: echo "TEST_COMMAND=cd ts-test;
# # npm install typescript --save-dev;
# # npx tsc;
# # cd ..;
# # npm run test dist/ -- --h 127.0.0.1 --port 3000" >> $GITHUB_ENV
# # shell: bash
#
#
# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# name: nodejs-client-artifacts
# path: ./downloaded-artifacts
#
# - name: list Artifacts first
# run: |
# ls ./downloaded-artifacts
#
# - name: Move artifacts
# run: |
# mkdir -p lib/binding
# cp -r downloaded-artifacts/* lib/binding
#
#
# - name: Delete leftover artifacts
# if: ${{ !(inputs.platform-tag == 'win_amd64') }}
# run: |
# rm -rf downloaded-artifacts/
#
# - name: check binding
# run:
# ls lib/binding;
#
# - name: Change install command for release
# run: node ./scripts/change-install-command.js
#
# - name: Run tests
# if: ${{ inputs.run_tests && startsWith(inputs.platform-tag, 'manylinux') }}
# run: |
# docker ps;
# docker logs aerospike;
# cd ts-test;
# npm install;
# npx tsc;
# cd ..;
# npx tsc;
# npm run test dist/${{ inputs.test-file }} -- --h localhost --port 3000;
#
# - name: Set final commit status
# uses: myrotvorets/[email protected]
# if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }}
# with:
# sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# status: ${{ job.status }}
# context: ${{ env.STATUS_CHECK_MESSAGE }}
# test-self-hosted-ee:
# # There's a top-level env variable for this but we can't use it here, unfortunately
# needs: get-runner-os
# strategy:
# fail-fast: false
# matrix:
# nodejs-tag: ${{ fromJSON(inputs.nodejs-tags) }}
# runs-on: ${{ needs.get-runner-os.outputs.runner-os }}
# if: ${{ inputs.run_tests && (inputs.platform-tag == 'macosx_arm64' || inputs.platform-tag == 'win_amd64') }}
# env:
# BUILD_IDENTIFIER: "${{ matrix.nodejs-tag[0] }}-${{ inputs.platform-tag }}"
# steps:
#
# # REUSABLE SECTION
# - name: Create status check message
# run: echo STATUS_CHECK_MESSAGE="Test on self hosted (${{ env.BUILD_IDENTIFIER }})" >> $GITHUB_ENV
# shell: bash
#
# - name: Show job status for commit
# uses: myrotvorets/[email protected]
# if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
# with:
# sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# context: ${{ env.STATUS_CHECK_MESSAGE }}
#
# - uses: actions/checkout@v4
# with:
# ref: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
#
# # Need to be able to save Docker Hub credentials to keychain
# - if: ${{ inputs.platform-tag == 'macosx_arm64' && inputs.use-server-rc }}
# run: security unlock-keychain -p ${{ secrets.MAC_M1_SELF_HOSTED_RUNNER_PW }}
#
# - name: Remove aerospike docker image
# if: ${{ inputs.platform-tag == 'macosx_arm64' }}
# run: |
# if docker ps -aq | grep -q .; then
# docker rm -f $(docker ps -aq) || echo "Failed to remove one or more containers."
# else
# echo "No containers to remove."
# fi
#
# - name: Remove aerospike docker image
# if: ${{ inputs.platform-tag == 'win_amd64' }}
# run: |
# if (docker ps -aq) {
# docker ps -aq | ForEach-Object { docker rm -f $_ } || Write-Host "Failed to remove one or more containers."
# }
# else {
# Write-Host "No containers to remove."
# }
#
# - name: 'macOS x86: run Aerospike server in Docker container and connect via localhost'
# uses: ./.github/actions/run-ee-server-for-ext-container
# with:
# use-server-rc: ${{ inputs.use-server-rc }}
# server-tag: ${{ inputs.server-tag }}
# docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
# docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}
#
# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# name: nodejs-client-artifacts
# path: ./downloaded-artifacts
#
# - name: list Artifacts first
# run: |
# ls ./downloaded-artifacts
#
# - name: Move artifacts
# run: |
# mkdir -p lib/binding
# cp -r downloaded-artifacts/* lib/binding
#
#
# - name: Delete leftover artifacts
# if: ${{ !(inputs.platform-tag == 'win_amd64') }}
# run: |
# rm -rf downloaded-artifacts/
#
# - name: check binding
# run: |
# ls lib/binding;
#
#
# #- name: Change install command for release
# # run: node ./scripts/change-install-command.js
#
# #- name: npm install
# # run: npm install
#
# - uses: actions/setup-node@v4
# #if: ${{ inputs.platform-tag == 'macosx_arm64' }}
# with:
# node-version: ${{ matrix.nodejs-tag[1] }}
# path: ./lib/binding/node-${{ matrix.nodejs-tag[0] }}-darwin-arm64/
#
#
# - name: Connect to Docker container on remote machine with Docker daemon
# if: ${{ inputs.platform-tag == 'win_amd64' }}
# # DOCKER_HOST contains the IP address of the remote machine
# run: |
# $env:DOCKER_HOST_IP = $env:DOCKER_HOST | foreach {$_.replace("tcp://","")} | foreach {$_.replace(":2375", "")}
# crudini --set config.conf enterprise-edition hosts ${env:DOCKER_HOST_IP}:3000
# working-directory: .github\workflows
#
# # REUSABLE SECTION
#
# - name: Run tests
# if: ${{ inputs.platform-tag == 'win_amd64' }}
# run: |
# docker ps;
# docker logs aerospike;
# cd ts-test;
# npm install;
# npx tsc;
# cp tests\udf.lua dist\udf.lua;
# npx mocha dist -- --h ${env:DOCKER_HOST_IP} --port 3000 --U superuser --P superuser;
# cd ..;
# npx tsc;
#
# - name: Run tests
# if: ${{ inputs.platform-tag == 'macosx_arm64' }}
# run: |
# docker ps;
# docker logs aerospike;
# cd ts-test;
# npm install;
# npx tsc;
# cd ..;
# npx tsc;
# npm run test dist/${{ inputs.test-file }} -- --h localhost --port 3000 --t 15000 --U superuser --P superuser;
#
#
# - name: Show job status for commit
# if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }}
# uses: myrotvorets/[email protected]
# with:
# sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# status: ${{ job.status }}
# context: ${{ env.STATUS_CHECK_MESSAGE }}
test-tsc-compile-self-hosted:
# There's a top-level env variable for this but we can't use it here, unfortunately
needs: get-runner-os
strategy:
fail-fast: false
matrix:
nodejs-tag: ${{ fromJSON(inputs.nodejs-tags) }}
runs-on: ${{ needs.get-runner-os.outputs.runner-os }}
if: ${{ inputs.run_tests && (inputs.platform-tag == 'macosx_arm64' || inputs.platform-tag == 'win_amd64') }}
env:
BUILD_IDENTIFIER: "${{ matrix.nodejs-tag[0] }}-${{ inputs.platform-tag }}"
steps:
# REUSABLE SECTION
- name: Create status check message
run: echo STATUS_CHECK_MESSAGE="Test on self hosted (${{ env.BUILD_IDENTIFIER }})" >> $GITHUB_ENV
shell: bash
- name: Show job status for commit
uses: myrotvorets/[email protected]
if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
- uses: actions/checkout@v4
with:
ref: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# Need to be able to save Docker Hub credentials to keychain
- if: ${{ inputs.platform-tag == 'macosx_arm64' && inputs.use-server-rc }}
run: security unlock-keychain -p ${{ secrets.MAC_M1_SELF_HOSTED_RUNNER_PW }}
- name: Set up JFrog credentials
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: https://aerospike.jfrog.io
with:
oidc-provider-name: gh-aerospike-clients
oidc-audience: aerospike/clients
- name: Download Artifacts from Jfrog
run: jf rt dl "clients-npm-dev-local/aerospike/${{ env.NEW_VERSION }}/" "downloaded-artifacts/"
env:
NEW_VERSION: ${{ inputs.version }}
PACKAGE_MANAGER: npm
- name: list Artifacts
run: |
ls downloaded-artifacts
ls downloaded-artifacts/aerospike
ls downloaded-artifacts/aerospike/${{ env.NEW_VERSION }}
env:
NEW_VERSION: ${{ inputs.version }}
- name: Move artifacts
run: |
tar --strip-components=1 -xvf aerospike-${{ env.NEW_VERSION }}.tgz
env:
NEW_VERSION: ${{ inputs.version }}
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: check binding
run:
ls lib/binding;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Change install command for release
run: node ./scripts/change-install-command.js
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
#- name: npm install
# run: npm install
- uses: actions/setup-node@v4
#if: ${{ inputs.platform-tag == 'macosx_arm64' }}
with:
node-version: ${{ matrix.nodejs-tag[1] }}
# REUSABLE SECTION
- name: Run tests
if: ${{ inputs.platform-tag == 'win_amd64' }}
run: |
npm install --only=dev;
npx tsc;
npx tsc typings/index.d.ts;
cd ts-test;
npm install;
npx tsc;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Run tests
if: ${{ inputs.platform-tag == 'macosx_arm64' }}
run: |
npm install --only=dev;
npx tsc;
npx tsc typings/index.d.ts;
cd ts-test;
npm install;
npx tsc;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Show job status for commit
if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }}
uses: myrotvorets/[email protected]
with:
sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
status: ${{ job.status }}
context: ${{ env.STATUS_CHECK_MESSAGE }}
test-user-agent:
needs: get-runner-os
strategy:
fail-fast: false
matrix:
nodejs-tag: ${{ fromJSON(inputs.nodejs-tags) }}
runs-on: ${{ needs.get-runner-os.outputs.runner-os }}
if: ${{ inputs.run_tests && (inputs.platform-tag != 'macosx_arm64' || inputs.platform-tag != 'win_amd64') }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:

Check failure on line 1466 in .github/workflows/test-dev-artifacts.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/test-dev-artifacts.yml

Invalid workflow file

You have an error in your yaml syntax on line 1466
node-version: ${{ matrix.nodejs-tag[1] }}
architecture: 'x64'
# ----------------------------------------------------------------------------------------
- name: Set up JFrog credentials
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: https://aerospike.jfrog.io
with:
oidc-provider-name: gh-aerospike-clients
oidc-audience: aerospike/clients
- name: Download Artifacts from Jfrog
run: jf rt dl "clients-npm-dev-local/aerospike/${{ env.NEW_VERSION }}/" "downloaded-artifacts/"
env:
NEW_VERSION: ${{ inputs.version }}
PACKAGE_MANAGER: npm
- name: list Artifacts
run: |
ls downloaded-artifacts
ls downloaded-artifacts/aerospike
ls downloaded-artifacts/aerospike/${{ env.NEW_VERSION }}
env:
NEW_VERSION: ${{ inputs.version }}
- name: Move artifacts
run: |
tar --strip-components=1 -xvf aerospike-${{ env.NEW_VERSION }}.tgz
env:
NEW_VERSION: ${{ inputs.version }}
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: check binding
run:
ls lib/binding;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Change install command for release
run: node ./scripts/change-install-command.js
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
# ----------------------------------------------------------------------------------------
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY_NAME }}
username: ${{ env.REGISTRY_NAME == 'docker.io' && secrets.DOCKER_HUB_BOT_USERNAME || secrets.QE_DOCKER_REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_NAME == 'docker.io' && secrets.DOCKER_HUB_BOT_PW || secrets.QE_DOCKER_REGISTRY_PASSWORD }}
- uses: ./.github/actions/run-ee-server
with:
registry-name: ${{ env.REGISTRY_NAME }}
server-tag: ${{ env.SERVER_TAG }}
registry-username: ${{ env.REGISTRY_NAME == 'docker.io' && secrets.DOCKER_HUB_BOT_USERNAME || secrets.QE_DOCKER_REGISTRY_USERNAME }}
registry-password: ${{ env.REGISTRY_NAME == 'docker.io' && secrets.DOCKER_HUB_BOT_PW || secrets.QE_DOCKER_REGISTRY_PASSWORD }}
- name: Run tests
run: |
npm install --only=dev;
npx tsc;
npx tsc typings/index.d.ts;
cd ts-test;
npm install;
npx tsc;
npm run test -- --t 40000 --h 127.0.0.1 --port 3000 --U superuser --P superuser;
working-directory: downloaded-artifacts/aerospike/${{ inputs.version }}
- name: Confirm that the user agent shows the correct client language and version (only for server 8.1)
run: |
server_version=$(docker exec ${{ env.CONTAINER_NAME }} asinfo -v build)
major_num=$(echo $server_version | cut -d '.' -f 1)
minor_num=$(echo $server_version | cut -d '.' -f 2)
if [[ $major_num -lt 8 || ( $major_num -eq 8 && $minor_num -lt 1 ) ]]; then
exit 0
fi
info_cmd_response_full=$(docker exec ${{ env.CONTAINER_NAME }} asinfo -v "user-agents")
echo "Info command response: $info_cmd_response_full"
info_cmd_response=$(docker exec ${{ env.CONTAINER_NAME }} asinfo -v "user-agents" | head -n 1)
echo "Info command response: $info_cmd_response"
# Response format: user-agent=<base64 encoded string>:...
user_agent_base64_encoded=$(echo $info_cmd_response | perl -n -E 'say $1 if m/user-agent= ([a-zA-Z0-9+\/=]+) :/x')
echo $user_agent_base64_encoded
user_agent=$(echo $user_agent_base64_encoded | base64 -d)
echo $user_agent
# User agent format: <format-version>,<client language>-<version>,...
client_language=$(echo $user_agent | perl -n -E 'say $1 if m/[0-9]+, ([a-z]+) -/x')
client_version=$(echo $user_agent | perl -n -E 'say $1 if m/[0-9]+,[a-z]+- ([0-9.a-zA-Z+]+),/x')
echo $client_language
echo $client_version
test "$client_language" = "nodejs"
# Client version from user agent
expected_client_version=$(node -p 'require("./package.json").version')
test "$client_version" = "$expected_client_version"
shell: bash
env:
CONTAINER_NAME: aerospike
#
# test-ce-self-hosted:
# needs: get-runner-os
# # There's a top-level env variable for this but we can't use it here, unfortunately
# strategy:
# fail-fast: false
# matrix:
# nodejs-tag: ${{ fromJSON(inputs.nodejs-tags) }}
# runs-on: ${{ needs.get-runner-os.outputs.runner-os }}
# if: ${{ inputs.run_tests && (inputs.platform-tag == 'macosx_arm64') }}
# env:
# BUILD_IDENTIFIER: "${{ matrix.nodejs-tag[0] }}-${{ inputs.platform-tag }}"
# steps:
#
# # REUSABLE SECTION
# - name: Create status check message
# run: echo STATUS_CHECK_MESSAGE="Test on self hosted (${{ env.BUILD_IDENTIFIER }})" >> $GITHUB_ENV
# shell: bash
#
# - name: Show job status for commit
# uses: myrotvorets/[email protected]
# if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
# with:
# sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# context: ${{ env.STATUS_CHECK_MESSAGE }}
#
# - uses: actions/checkout@v4
# with:
# ref: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
#
# # Need to be able to save Docker Hub credentials to keychain
# - if: ${{ inputs.platform-tag == 'macosx_arm64' && inputs.use-server-rc }}
# run: security unlock-keychain -p ${{ secrets.MAC_M1_SELF_HOSTED_RUNNER_PW }}
#
# - name: Remove aerospike docker image
# if: ${{ inputs.platform-tag == 'macosx_arm64' }}
# run: |
# if docker ps -aq | grep -q .; then
# docker rm -f $(docker ps -aq) || echo "Failed to remove one or more containers."
# else
# echo "No containers to remove."
# fi
#
# - name: Remove aerospike docker image
# if: ${{ inputs.platform-tag == 'win_amd64' }}
# run: |
# if (docker ps -aq) {
# docker ps -aq | ForEach-Object { docker rm -f $_ } || Write-Host "Failed to remove one or more containers."
# }
# else {
# Write-Host "No containers to remove."
# }
#
# - name: Run latest Community edition Aerospike server
# run: docker run -d --network=host --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server
#
# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# name: nodejs-client-artifacts
# path: ./downloaded-artifacts
#
# - name: list Artifacts first
# run: |
# ls ./downloaded-artifacts
#
# - name: Move artifacts
# run: |
# mkdir -p lib/binding
# cp -r downloaded-artifacts/* lib/binding
#
#
# - name: Delete leftover artifacts
# if: ${{ !(inputs.platform-tag == 'win_amd64') }}
# run: |
# rm -rf downloaded-artifacts/
#
# - name: check binding
# run: |
# ls lib/binding;
#
#
# #- name: Change install command for release
# # run: node ./scripts/change-install-command.js
#
# #- name: npm install
# # run: npm install
#
# - uses: actions/setup-node@v4
# # if: ${{ inputs.platform-tag == 'macosx_arm64' }}
# with:
# node-version: ${{ matrix.nodejs-tag[1] }}
# path: ./lib/binding/node-${{ matrix.nodejs-tag[0] }}-darwin-arm64/
#
#
# - name: Connect to Docker container on remote machine with Docker daemon
# if: ${{ inputs.platform-tag == 'win_amd64' }}
# # DOCKER_HOST contains the IP address of the remote machine
# run: |
# $env:DOCKER_HOST_IP = $env:DOCKER_HOST | foreach {$_.replace("tcp://","")} | foreach {$_.replace(":2375", "")}
# crudini --set config.conf community-edition hosts ${env:DOCKER_HOST_IP}:3000
# working-directory: .github\workflows
#
# # REUSABLE SECTION
#
# - name: Run tests
# if: ${{ inputs.platform-tag == 'win_amd64' }}
# run: |
# docker ps;
# docker logs aerospike;
# cd ts-test;
# npm install;
# npx tsc;
# cp tests\udf.lua dist\udf.lua;
# npx mocha dist -- --h ${env:DOCKER_HOST_IP} --port 3000;
# cd ..;
# npx tsc;
#
# - name: Run tests
# if: ${{ inputs.platform-tag == 'macosx_arm64' }}
# run: |
# docker ps;
# docker logs aerospike;
# cd ts-test;
# npm install;
# npx tsc;
# cd ..;
# npx tsc;
# npm run test dist/${{ inputs.test-file }} -- --h localhost --port 3000 --t 15000;
#
#
# - name: Show job status for commit
# if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }}
# uses: myrotvorets/[email protected]
# with:
# sha: ${{ env.COMMIT_SHA_TO_BUILD_AND_TEST }}
# status: ${{ job.status }}
# context: ${{ env.STATUS_CHECK_MESSAGE }}
#
#
#