chore: TOOLS-2708 remove truncate command after deprecation #68
Workflow file for this run
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, main, test-ready, "*-bugfix"] | |
pull_request: | |
branches: [main, test-ready] | |
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: aql | |
- name: Get aql 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: aql | |
- 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: Cache Aql | |
uses: actions/cache@v3 | |
id: cache-aql | |
env: | |
cache-name: cache-aql | |
cache-index: "9" # To clear the cache if needed. | |
with: | |
path: | | |
${{ steps.working-dir.outputs.value }}/target | |
key: ${{ runner.os }}-${{ runner.arch }}-${{ steps.system-info.outputs.release }}-build-${{ env.cache-name }}-${{ env.cache-index }}-${{ steps.tag.outputs.tag }} | |
- name: Download C Client Deps | |
run: | | |
brew install automake | |
- name: Cache C Client | |
uses: actions/cache@v3 | |
if: steps.cache-aql.outputs.cache-hit != 'true' | |
env: | |
cache-name: cache-c-client | |
with: | |
path: | | |
${{ steps.working-dir.outputs.value }}/modules/c-client/target | |
key: ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-${{ hashFiles(format('{0}/modules/c-client/**/*', steps.working-dir.outputs.value)) }} | |
- name: Cache Jansson | |
uses: actions/cache@v3 | |
if: steps.cache-aql.outputs.cache-hit != 'true' | |
env: | |
cache-name: cache-jansson | |
with: | |
path: | | |
${{ steps.working-dir.outputs.value }}/modules/jansson/src | |
key: ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-${{ hashFiles(format('{0}/modules/jansson/**/*', steps.working-dir.outputs.value)) }} | |
- name: Build aql | |
if: steps.cache-aql.outputs.cache-hit != 'true' | |
working-directory: ${{ steps.working-dir.outputs.value }} | |
run: | | |
make OPENSSL_STATIC_PATH=/usr/local/opt/openssl/lib | |
- name: Sanity Test tools | |
working-directory: ${{ steps.working-dir.outputs.value }} | |
run: | | |
cd target/Darwin-x86_64/bin | |
./aql -e "info" 2>&1 | grep "Failed to connect" | |
- name: Set Upload Arch | |
uses: haya14busa/action-cond@v1 | |
id: upload-arch | |
with: | |
cond: ${{ runner.arch == 'X64' }} | |
if_true: x86_64 | |
if_false: aarch64 | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.system-info.outputs.platform }}-${{ runner.arch }}-${{ runner.os }}-${{ steps.system-info.outputs.release }}-aql | |
path: ${{ steps.working-dir.outputs.value }}/target/Darwin-${{ steps.upload-arch.outputs.value }}/bin/aql |