-
Notifications
You must be signed in to change notification settings - Fork 19
107 lines (105 loc) · 4.09 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
106
107
name: Mac Artifact
on:
repository_dispatch:
types: mac-build
push:
branches: [actionsHub, master, "bugfix-*"]
pull_request:
branches: [master]
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]
runs-on: ${{ matrix.os }}
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: admin
- name: Get asadm 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: admin
- 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 and get version
working-directory: ${{ steps.working-dir.outputs.value }}
id: tag
run: |
git describe --tags --always
echo "tag=$(git describe --tags --always)" >> $GITHUB_OUTPUT
- uses: kenchan0130/[email protected]
id: system-info
- name: Get Python version from Pipfile
working-directory: ${{ steps.working-dir.outputs.value }}
run: |
git rev-parse HEAD
echo "PYTHON_VERSION=$(grep "python_version" Pipfile | cut -d ' ' -f 3 - | tr -d '"')" >> $GITHUB_ENV
echo ${{ steps.system-info.outputs.name }}
echo ${{ steps.system-info.outputs.kernel-release }}
echo ${{ steps.system-info.outputs.platform }}
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pipenv"
- name: Cache asadm and asinfo
uses: actions/cache@v3
id: cache-asadm-asinfo
env:
cache-name: cache-asadm-asinfo
cache-index: "4"
with:
path: |
${{ steps.working-dir.outputs.value }}/build/bin
key: ${{ env.cache-name }}-${{ env.cache-index }}-${{ matrix.os }}-${{ runner.arch }}-${{ steps.system-info.outputs.release }}-${{ env.PYTHON_VERSION }}-${{ steps.tag.outputs.tag }}
- name: Pipenv setup
if: steps.cache-asadm-asinfo.outputs.cache-hit != 'true'
working-directory: ${{ steps.working-dir.outputs.value }}
run: |
brew install pipenv
- name: Build asadm
if: steps.cache-asadm-asinfo.outputs.cache-hit != 'true'
working-directory: ${{ steps.working-dir.outputs.value }}
run: |
make one-dir
ls -al build/bin/asadm || true
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Sanity Test tools
working-directory: ${{ steps.working-dir.outputs.value }}
run: |
sudo make install
asadm -e "info" || true
asadm -e "info" 2>&1 | grep "Not able to connect"
asinfo || true
asinfo 2>&1 | grep "Not able to connect"
- name: Create .tar
working-directory: ${{ steps.working-dir.outputs.value }}
run: |
tar -C build/bin/ -cvf asadm.tar asadm
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.system-info.outputs.platform }}-${{ runner.arch }}-${{ matrix.os }}-${{ steps.system-info.outputs.release }}-asadm
path: ${{ steps.working-dir.outputs.value }}/asadm.tar
if-no-files-found: error