-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a77e18
commit a4977fa
Showing
11 changed files
with
423 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Build and est | ||
description: "Build and test code base" | ||
|
||
inputs: | ||
crypto-type: | ||
description: "" | ||
required: false | ||
default: gnu | ||
use-server-rc: | ||
required: false | ||
default: "false" | ||
description: "Test against server release candidate?" | ||
server-tag: | ||
required: false | ||
default: "latest" | ||
description: "Server docker image tag" | ||
jfrog_docker_username: | ||
required: true | ||
description: "" | ||
jfrog_docker_token: | ||
required: true | ||
description: "" | ||
run-tests: | ||
required: true | ||
default: "false" | ||
description: Spin up aerospike enterprise server and run tests | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Build | ||
shell: bash | ||
run: mvn clean install -Dcrypto.type=${{ inputs.crypto-type == 'bouncycastle' && '-bc' || '' }} | ||
|
||
- name: Run EE server | ||
if: ${{ inputs.run-tests == 'true' }} | ||
uses: ./.github/actions/run-ee-server | ||
with: | ||
use-server-rc: ${{ inputs.use-server-rc }} | ||
server-tag: ${{ inputs.server-tag }} | ||
docker-hub-username: ${{ inputs.jfrog_docker_username }} | ||
docker-hub-password: ${{ inputs.jfrog_docker_token }} | ||
|
||
- name: Test | ||
shell: bash | ||
if: ${{ inputs.run-tests == true }} | ||
working-directory: test | ||
run: mvn test -DskipTests=false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Publish artifacts to JFrog | ||
description: "Publishes artifacts to JFrog" | ||
|
||
inputs: | ||
jfrog-releases-repo-name: | ||
description: "" | ||
required: false | ||
default: clients-maven-dev-local | ||
jfrog-snapshots-repo-name: | ||
description: "" | ||
required: false | ||
default: clients-maven-dev-local | ||
jfrog-platform-url: | ||
description: "" | ||
required: false | ||
default: https://aerospike.jfrog.io/ | ||
oidc-provider: | ||
description: "" | ||
required: false | ||
default: gh-aerospike-clients | ||
oidc-audience: | ||
description: "" | ||
required: false | ||
default: aerospike/clients | ||
crypto-type: | ||
description: "" | ||
required: false | ||
default: gnu | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up JFrog credentials | ||
uses: jfrog/setup-jfrog-cli@v4 | ||
env: | ||
JF_URL: ${{ inputs.jfrog-platform-url }} | ||
with: | ||
oidc-provider-name: ${{ inputs.oidc-provider }} | ||
oidc-audience: ${{ inputs.oidc-audience }} | ||
|
||
- name: Deploy release | ||
shell: bash | ||
working-directory: client | ||
run: | | ||
jf mvn-config --repo-deploy-releases=${{ inputs.jfrog-releases-repo-name }} --repo-deploy-snapshots=${{ inputs.jfrog-snapshots-repo-name }} | ||
jf mvn source:jar javadoc:jar deploy -Dcrypto.type=${{ inputs.crypto-type == 'bouncycastle' && '-bc' || '' }} -Dusername=${{ steps.setup-jfrog-cli.outputs.oidc-user }} ${{ steps.setup-jfrog-cli.outputs.oidc-token }} | ||
jf rt bp |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: "Run EE Server" | ||
description: "Run EE server. Returns once server is ready. Only tested on Linux and macOS" | ||
|
||
inputs: | ||
# All inputs in composite actions are strings | ||
use-server-rc: | ||
description: Flag for rc candidates | ||
required: true | ||
default: "false" | ||
server-tag: | ||
description: Server version to use | ||
required: true | ||
default: "latest" | ||
container-repo-url: | ||
required: false | ||
description: Container repo url | ||
default: aerospike.jfrog.io/docker/ | ||
oidc-provider: | ||
description: "" | ||
required: false | ||
default: gh-aerospike-clients | ||
oidc-audience: | ||
description: "" | ||
required: false | ||
default: aerospike/clients | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up JFrog credentials | ||
uses: jfrog/setup-jfrog-cli@v4 | ||
env: | ||
JF_URL: ${{ inputs.jfrog-platform-url }} | ||
with: | ||
oidc-provider-name: ${{ inputs.oidc-provider }} | ||
oidc-audience: ${{ inputs.oidc-audience }} | ||
|
||
- name: Log into Docker Hub to get server RC | ||
if: ${{ inputs.use-server-rc == 'true' }} | ||
run: docker login ${{ inputs.container-repo-url }} --username ${{ inputs.docker-hub-username }} --password ${{ inputs.docker-hub-password }} | ||
shell: bash | ||
|
||
- run: echo IMAGE_NAME=${{ inputs.use-server-rc == 'true' && inputs.container-repo-url || '' }}aerospike/aerospike-server-enterprise${{ inputs.use-server-rc == 'true' && '-rc' || '' }}:${{ inputs.server-tag }} >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- run: docker run -d --name aerospike -p 3000:3000 ${{ env.IMAGE_NAME }} | ||
shell: bash | ||
|
||
- uses: ./.github/actions/wait-for-as-server-to-start | ||
with: | ||
container-name: aerospike | ||
is-security-enabled: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: "Wait for Aerospike server to start" | ||
description: Only tested on Linux and macOS | ||
inputs: | ||
container-name: | ||
description: Container name | ||
required: true | ||
is-security-enabled: | ||
description: Flag to toggle docker hub creds use. With this flag enabled before attempting to pull image we will attempt to log in do docker hub. | ||
required: false | ||
default: "false" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
# Composite actions doesn't support step-level timeout-minutes | ||
# Use timeout command and store polling logic in file to make it easier to read | ||
# Call bash shell explicitly since timeout uses "sh" shell by default, for some reason | ||
# Also, we don't want to fail if we timeout in case the server *did* finish starting up but the script couldn't detect it due to a bug | ||
# Effectively, this composite action is like calling "sleep" that is optimized to exit early when it detects an ok from the server | ||
- name: Wait for EE server to start | ||
run: timeout 30 bash ./.github/workflows/scripts/wait-for-as-server-to-start.sh ${{ inputs.container-name }} ${{ inputs.is-security-enabled }} || true | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
type: string | ||
required: true | ||
source-branch: | ||
type: string | ||
required: false | ||
use-server-rc: | ||
type: boolean | ||
required: false | ||
default: false | ||
description: "Test against server release candidate?" | ||
server-tag: | ||
type: string | ||
required: false | ||
default: "latest" | ||
description: "Server docker image tag" | ||
upload-artifacts: | ||
type: boolean | ||
required: false | ||
default: false | ||
description: "Upload built artifacts to github?" | ||
bump-version: | ||
type: boolean | ||
required: false | ||
default: false | ||
description: "Bump artifact version" | ||
run-tests: | ||
type: boolean | ||
required: false | ||
default: false | ||
description: Spin up aerospike enterprise server and run tests | ||
|
||
jobs: | ||
debug-job: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: debug | ||
run: | | ||
echo "${{ inputs.branch }}" | ||
echo "${{ github.base_ref }}" | ||
java-version: | ||
needs: debug-job | ||
runs-on: ubuntu-latest | ||
outputs: | ||
java-version: ${{ steps.get-java-version.outputs.java-version }} | ||
steps: | ||
- name: Checkout client | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Get java version | ||
id: get-java-version | ||
run: | | ||
echo java-version="$(grep '<java.version>' pom.xml | sed -e 's/<[^>]*>//g' | awk '{$1=$1};1')" >> $GITHUB_OUTPUT | ||
- name: debug - print java-version | ||
run: | | ||
echo ${{ steps.get-java-version.outputs.java-version }} | ||
debug-java-version-job: | ||
runs-on: ubuntu-latest | ||
needs: java-version | ||
steps: | ||
- name: debug | ||
run: | | ||
echo "${{ needs.java-version.outputs.java-version }}" | ||
build: | ||
uses: ./.github/workflows/build.yaml | ||
needs: java-version | ||
strategy: | ||
matrix: | ||
crypto-type: ["bouncycastle", "gnu"] | ||
with: | ||
java-version: ${{ needs.java-version.outputs.java-version }} | ||
branch: ${{ inputs.branch }} | ||
use-server-rc: ${{ inputs.use-server-rc }} | ||
run-tests: ${{ inputs.run-tests }} | ||
server-tag: ${{ inputs.server-tag }} | ||
upload-artifacts: ${{ inputs.upload-artifacts }} | ||
crypto-type: ${{ matrix.crypto-type }} | ||
secrets: inherit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Build artifacts | ||
|
||
permissions: | ||
# This is required for requesting the OIDC token | ||
id-token: write | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
type: string | ||
required: true | ||
java-version: | ||
type: string | ||
required: true | ||
use-server-rc: | ||
type: boolean | ||
required: false | ||
default: false | ||
description: "Test against server release candidate?" | ||
server-tag: | ||
type: string | ||
required: false | ||
default: "latest" | ||
description: "Server docker image tag" | ||
upload-artifacts: | ||
type: boolean | ||
required: false | ||
default: false | ||
description: "Upload built artifacts to github?" | ||
run-tests: | ||
type: boolean | ||
required: false | ||
default: false | ||
description: Spin up aerospike enterprise server and run tests | ||
crypto-type: | ||
type: string | ||
required: true | ||
secrets: | ||
GPG_SECRET_KEY: | ||
required: true | ||
GPG_PASS: | ||
required: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout client | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "semeru" # See 'Supported distributions' for available options | ||
java-version: ${{ inputs.java-version }} | ||
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} | ||
gpg-passphrase: ${{ secrets.GPG_PASS }} | ||
|
||
- name: Build and test | ||
uses: ./.github/actions/build-and-test | ||
with: | ||
crypto-type: ${{ inputs.crypto-type }} | ||
server-tag: ${{ inputs.server-tag }} | ||
use-server-rc: ${{ inputs.use-server-rc }} | ||
|
||
- name: Publish to JFrog | ||
if: ${{ !cancelled() && inputs.upload-artifacts == true }} | ||
uses: ./.github/actions/publish-to-jfrog | ||
with: | ||
crypto-type: ${{ inputs.crypto-type }} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: PR open | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "dev/*" | ||
types: | ||
- opened | ||
- reopened | ||
workflow_dispatch: | ||
inputs: | ||
source-branch: | ||
type: string | ||
description: Base branch to use if manually starting. By default base_ref will empty if triggering manually hence base_ref is only available on PRs. | ||
|
||
jobs: | ||
test-with-server-release: | ||
name: Build stage - Test with latest version of Aerospike Enterprise Server | ||
uses: ./.github/workflows/build-dev.yaml | ||
with: | ||
branch: ${{ github.ref }} | ||
source-branch: ${{ inputs.source-branch || github.base_ref }} | ||
use-server-rc: false | ||
upload-artifacts: false | ||
secrets: inherit | ||
|
||
test-with-server-rc: | ||
name: Build stage - Test with latest RC version of Aerospike Enterprise Server | ||
uses: ./.github/workflows/build-dev.yaml | ||
with: | ||
branch: ${{ github.base_ref || inputs.branch }} | ||
source-branch: ${{ inputs.source-branch || github.base_ref }} | ||
use-server-rc: true | ||
upload-artifacts: false | ||
run-tests: true | ||
secrets: inherit |
Oops, something went wrong.