Skip to content

Commit

Permalink
build: TOOLS-2937 use github actions to build m-series macos (#101)
Browse files Browse the repository at this point in the history
* build: add mac11 build

* build: bump macos-11 runners to macos-12

* ci: check for subclasses of dict, python client 15 and up may return aerospike.KeyOrderedDict

* build: bump bundle runner to macos-14

---------

Co-authored-by: dwelch-spike <[email protected]>
Co-authored-by: dylan <[email protected]>
  • Loading branch information
3 people authored Jul 30, 2024
1 parent b0cc632 commit dd4b249
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 15 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/mac-artifact.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Mac Artifact
on:
push:
branches: [ main, test-ready, "bugfix-*" ]
branches: [ main, actionsHub, "bugfix-*" ]
pull_request:
branches: []
workflow_call:
Expand All @@ -12,10 +12,19 @@ on:
type: string
jobs:
build:
runs-on: macos-11
strategy:
matrix:
ev-lib: ["", libev, libuv, libevent]
os: [macos-12, macos-14]
# ev-lib: ["", libev, libuv, libevent]
ev-lib: [libuv]
include:
- os: macos-12
openssl-path: /usr/local/opt/openssl
ev-path: /usr/local
- os: macos-14
openssl-path: /opt/homebrew/opt/openssl
ev-path: /opt/homebrew
runs-on: ${{ matrix.os }}
env:
LIBYAML_VERSION: 0.2.5
steps:
Expand All @@ -33,7 +42,7 @@ jobs:
cond: ${{ inputs.submodule != '' }}
if_true: aerospike-tools/${{ inputs.submodule }} # In this case we are expecting to checkout the tools package.
if_false: asbench
- uses: kenchan0130/actions-system-info@v1.1.0
- uses: kenchan0130/actions-system-info@v1.3.0
id: system-info
- name: Install dependencies from brew
run: |
Expand All @@ -55,7 +64,7 @@ jobs:
git describe --tags --always
- name: Build asbench
run: |
make EVENT_LIB=${{ matrix.ev-lib }} LIBUV_STATIC_PATH=/usr/local/lib LIBEVENT_STATIC_PATH=/usr/local/lib LIBEV_STATIC_PATH=/usr/local/lib OPENSSL_STATIC_PATH=/usr/local/opt/openssl/lib
make EVENT_LIB=${{ matrix.ev-lib }} LIBUV_STATIC_PATH=${{ matrix.ev-path }}/lib LIBEVENT_STATIC_PATH=${{ matrix.ev-path }}/lib LIBEV_STATIC_PATH=${{ matrix.ev-path }}/lib OPENSSL_STATIC_PATH=${{ matrix.openssl-path }}/lib
working-directory: ${{ steps.working-dir.outputs.value }}
- name: Sanity test asbench artifact
run: |
Expand All @@ -69,24 +78,24 @@ jobs:
if_true: asbench
if_false: asbench-${{ matrix.ev-lib }}
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.system-info.outputs.platform }}-${{ runner.arch }}-${{ runner.os }}-${{ steps.system-info.outputs.release }}-${{ steps.artifact-name.outputs.value }}
path: ${{ steps.working-dir.outputs.value }}/target/asbench
if-no-files-found: error
bundle-binaries:
needs: build
runs-on: macos-11
runs-on: macos-14
if: "${{ inputs.submodule == '' }}"

steps:
- uses: kenchan0130/actions-system-info@v1.1.0
- uses: kenchan0130/actions-system-info@v1.3.0
id: system-info
- name: Get artifacts
uses: actions/download-artifact@v3
with:
path: target
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: binaries
path: target
Expand Down
20 changes: 14 additions & 6 deletions src/test/integration/test_object_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def check_bin(b):

def test_map():
def check_bin(b):
assert(type(b) is dict)
# Python client may return a aerospike.KeyOrderedDict
assert(issubclass(type(b), dict))
assert(len(b) == 50)
for key in b:
lib.obj_spec_is_S(key, 5)
Expand All @@ -171,7 +172,8 @@ def check_bin(b):

def test_const_map():
def check_bin(b):
assert(type(b) is dict)
# Python client may return a aerospike.KeyOrderedDict
assert(issubclass(type(b), dict))
assert(len(b) == 1)
for key in b:
lib.obj_spec_is_const_I(key, 123)
Expand All @@ -186,7 +188,8 @@ def check_bin(b):
assert(type(b) is list)
assert(len(b) == 3)

assert(type(b[0]) is dict)
# Python client may return a aerospike.KeyOrderedDict
assert(issubclass(type(b[0]), dict))
assert(len(b[0]) == 50)
for key in b[0]:
lib.obj_spec_is_S(key, 5)
Expand All @@ -199,7 +202,9 @@ def check_bin(b):

lib.obj_spec_is_D(b[2][0])
lib.obj_spec_is_I2(b[2][1])
assert(type(b[2][2]) is dict)

# Python client may return a aerospike.KeyOrderedDict
assert(issubclass(type(b[2][2]), dict))
assert(len(b[2][2]) == 10)
for key in b[2][2]:
lib.obj_spec_is_I5(key)
Expand Down Expand Up @@ -231,7 +236,9 @@ def check_bins(b):

assert(type(b["testbin"]) is list)
lib.obj_spec_is_I1(b["testbin"][0])
assert(type(b["testbin"][1]) is dict)

# Python client may return a aerospike.KeyOrderedDict
assert(issubclass(type(b["testbin"][1]), dict))
assert(len(b["testbin"][1]) == 45)
for key in b["testbin"][1]:
lib.obj_spec_is_S(key, 32)
Expand All @@ -240,7 +247,8 @@ def check_bins(b):
lib.obj_spec_is_I2(b["testbin_2"])
lib.obj_spec_is_I3(b["testbin_3"])

assert(type(b["testbin_4"]) is dict)
# Python client may return a aerospike.KeyOrderedDict
assert(issubclass(type(b["testbin_4"]), dict))
assert(len(b["testbin_4"]) == 1)
for key in b["testbin_4"]:
lib.obj_spec_is_S(key, 10)
Expand Down

0 comments on commit dd4b249

Please sign in to comment.