Skip to content

Commit

Permalink
ci: add context argument in build-greptime-binary action
Browse files Browse the repository at this point in the history
  • Loading branch information
zyy17 committed Aug 9, 2023
1 parent 2ac51c6 commit da3fc87
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/actions/build-greptime-binary/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,17 @@ inputs:
description: Upload to S3
required: false
default: 'true'
context:
description: Context to build the docker image
required: false
default: .
runs:
using: composite
steps:
- name: Build greptime binary
shell: bash
run: |
cd ${{ inputs.context }} && \
make build-greptime-by-buildx \
CARGO_PROFILE=${{ inputs.cargo-profile }} \
FEATURES=${{ inputs.features }} \
Expand Down
8 changes: 8 additions & 0 deletions .github/actions/build-linux-artifacts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ inputs:
description: Upload to S3
required: false
default: 'true'
context:
description: Context to build the docker image
required: false
default: .
runs:
using: composite
steps:
Expand All @@ -41,6 +45,7 @@ runs:
shell: bash
# NOTE: If the BUILD_JOBS > 4, it's always OOM in EC2 instance.
run: |
cd ${{ inputs.context }} && \
make run-it-in-container BUILD_JOBS=4
- name: Upload sqlness logs
Expand All @@ -64,6 +69,7 @@ runs:
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
aws-region: ${{ inputs.aws-region }}
upload-to-s3: ${{ inputs.upload-to-s3 }}
context: ${{ inputs.context }}

- name: Build greptime without pyo3
if: ${{ inputs.dev-mode == 'false' }}
Expand All @@ -79,6 +85,7 @@ runs:
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
aws-region: ${{ inputs.aws-region }}
upload-to-s3: ${{ inputs.upload-to-s3 }}
context: ${{ inputs.context }}

- name: Build greptime on centos base image
uses: ./.github/actions/build-greptime-binary
Expand All @@ -94,3 +101,4 @@ runs:
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
aws-region: ${{ inputs.aws-region }}
upload-to-s3: ${{ inputs.upload-to-s3 }}
context: ${{ inputs.context }}
4 changes: 2 additions & 2 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ jobs:
path: ${{ env.CHECKOUT_GREPTIMEDB_PATH }}

- uses: ./.github/actions/build-linux-artifacts
working-directory: ${{ env.CHECKOUT_GREPTIMEDB_PATH }}
with:
arch: amd64
cargo-profile: ${{ env.CARGO_PROFILE }}
Expand All @@ -171,6 +170,7 @@ jobs:
aws-region: ${{ vars.AWS_RELEASE_BUCKET_REGION }}
dev-mode: true # Only build the standard greptime binary.
upload-to-s3: false # No need to upload to S3.
context: ${{ env.CHECKOUT_GREPTIMEDB_PATH }}

build-linux-arm64-artifacts:
name: Build linux-arm64 artifacts
Expand All @@ -193,7 +193,6 @@ jobs:
path: ${{ env.CHECKOUT_GREPTIMEDB_PATH }}

- uses: ./.github/actions/build-linux-artifacts
working-directory: ${{ env.CHECKOUT_GREPTIMEDB_PATH }}
with:
arch: arm64
cargo-profile: ${{ env.CARGO_PROFILE }}
Expand All @@ -205,6 +204,7 @@ jobs:
aws-region: ${{ vars.AWS_RELEASE_BUCKET_REGION }}
dev-mode: true # Only build the standard greptime binary.
upload-to-s3: false # No need to upload to S3.
context: ${{ env.CHECKOUT_GREPTIMEDB_PATH }}

release-images-to-dockerhub:
name: Build and push images to DockerHub
Expand Down

0 comments on commit da3fc87

Please sign in to comment.