-
Notifications
You must be signed in to change notification settings - Fork 12
105 lines (104 loc) · 3.83 KB
/
mac-artifact.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Mac Artifact
on:
push:
branches: [ main, actionsHub, "bugfix-*" ]
pull_request:
branches: []
workflow_call:
inputs:
submodule:
description: The directory of the submodule, if this workflow is being called on a submodule
required: false
type: string
jobs:
build:
strategy:
matrix:
os: [macos-13, macos-14, macos-15]
# ev-lib: ["", libev, libuv, libevent]
ev-lib: [libuv]
include:
- os: macos-13
openssl-path: /usr/local/opt/openssl
ev-path: /usr/local
- os: macos-14
openssl-path: /opt/homebrew/opt/openssl
ev-path: /opt/homebrew
- os: macos-15
openssl-path: /opt/homebrew/opt/openssl
ev-path: /opt/homebrew
runs-on: ${{ matrix.os }}
env:
LIBYAML_VERSION: 0.2.5
steps:
- name: Get checkout directory
uses: haya14busa/action-cond@v1
id: checkout-dir
with:
cond: ${{ inputs.submodule != '' }}
if_true: aerospike-tools # In this case we are expecting to checkout the tools package.
if_false: asbench
- name: Get asbench working directory
uses: haya14busa/action-cond@v1
id: working-dir
with:
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/[email protected]
id: system-info
- name: Install dependencies from brew
run: |
brew install libev openssl@3 automake # libuv and libevent already installed
# this will checkout the whole tools repo when run from aerospike-tools, but we will
# just cd into the correct directory calculated from working-dir
- uses: actions/checkout@v3
with:
path: ${{ steps.checkout-dir.outputs.value }}
fetch-depth: 0
- name: Checkout ${{ steps.working-dir.outputs.value }}
working-directory: ${{ steps.checkout-dir.outputs.value }}
run: |
git config --global url."https://github.com/".insteadOf "[email protected]:"
git submodule update --init --recursive -- ${{ inputs.submodule || '.' }}
- name: Print version
working-directory: ${{ steps.working-dir.outputs.value }}
run: |
git describe --tags --always
- name: Build asbench
run: |
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: |
./asbench | grep "ERROR Failed to connect"
working-directory: ${{ steps.working-dir.outputs.value }}/target
- name: Get artifact name
uses: haya14busa/action-cond@v1
id: artifact-name
with:
cond: ${{ matrix.ev-lib == '' }}
if_true: asbench
if_false: asbench-${{ matrix.ev-lib }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.system-info.outputs.platform }}-${{ runner.arch }}-${{ matrix.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-14
if: "${{ inputs.submodule == '' }}"
steps:
- uses: kenchan0130/[email protected]
id: system-info
- name: Get artifacts
uses: actions/download-artifact@v4
with:
path: target
- uses: actions/upload-artifact@v4
with:
name: binaries
path: target
if-no-files-found: error