TOOLS-2541 TOOLS-2697 Fix security ldap gen conf (#209) #517
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Mac Artifact | |
on: | |
repository_dispatch: | |
types: mac-build | |
push: | |
branches: [actionsHub, master, test-ready, "bugfix-*"] | |
pull_request: | |
branches: [test-ready, 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: | |
runs-on: macos-11 | |
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/actions-system-info@master | |
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_full_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 }}-${{ runner.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 }} | |
# wheel upgrade can be removed when python 3.9 ships with wheel >= 0.38. Currently it is 0.37.1 and pipenv check fails because of a security issue. | |
run: | | |
brew install pipenv | |
pipenv run pip install --upgrade wheel | |
pipenv check | |
- 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" 2>&1 | grep "Not able to connect" | |
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@v3 | |
with: | |
name: ${{ steps.system-info.outputs.platform }}-${{ runner.arch }}-${{ runner.os }}-${{ steps.system-info.outputs.release }}-asadm | |
path: ${{ steps.working-dir.outputs.value }}/asadm.tar | |
if-no-files-found: error |