Skip to content

Commit

Permalink
ci: use BUILD_PROFILE for artifact download/upload (#11279)
Browse files Browse the repository at this point in the history
* ci: use BUILD_PROFILE for artifact download/upload

* ci: use 16c32g for build_hive and test_unit

* fix: larger build timeout

* fix: codegen-units to default

* ci: add workflow to cancel workflow when pr close
  • Loading branch information
everpcpc authored Apr 30, 2023
1 parent aa97d2c commit e8e9079
Show file tree
Hide file tree
Showing 28 changed files with 79 additions and 159 deletions.
13 changes: 5 additions & 8 deletions .github/actions/artifact_download/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: "Download Artifacts"
description: "Download build Result Binaries"
inputs:
profile:
description: "debug/release"
required: true
sha:
description: "git sha"
required: true
Expand All @@ -15,7 +12,7 @@ inputs:
required: false
default: default
path:
description: "default to ./target/{inputs.profile}/"
description: "default to ./target/${BUILD_PROFILE}/"
required: false
default: ""
outputs:
Expand All @@ -38,7 +35,7 @@ runs:
shell: bash
run: |
if [[ -z "${{ inputs.path }}" ]]; then
path="./target/${{ inputs.profile }}"
path="./target/${{ env.BUILD_PROFILE }}"
else
path="${{ inputs.path }}"
fi
Expand All @@ -54,18 +51,18 @@ runs:
- uses: actions/download-artifact@v3
if: steps.info.outputs.src == 'github'
with:
name: ${{ inputs.profile }}-${{ inputs.sha }}-${{ inputs.target }}-${{ inputs.category }}
name: ${{ env.BUILD_PROFILE }}-${{ inputs.sha }}-${{ inputs.target }}-${{ inputs.category }}
path: ${{ steps.info.outputs.path }}/

- name: Download artifact from s3
if: steps.info.outputs.src == 's3'
shell: bash
run: |
aws s3 sync \
s3://databend-ci/${{ inputs.profile }}/${{ inputs.sha }}/${{ inputs.target }}/${{ inputs.category }}/ \
s3://databend-ci/${{ env.BUILD_PROFILE }}/${{ inputs.sha }}/${{ inputs.target }}/${{ inputs.category }}/ \
${{ steps.info.outputs.path }}/ --exclude "*" --include "databend-*" --no-progress
aws s3 sync \
s3://databend-ci/${{ inputs.profile }}/${{ inputs.sha }}/${{ inputs.target }}/${{ inputs.category }}/ \
s3://databend-ci/${{ env.BUILD_PROFILE }}/${{ inputs.sha }}/${{ inputs.target }}/${{ inputs.category }}/ \
${{ steps.info.outputs.path }}/ --exclude "*" --include "open-sharing" --no-progress || true
- name: make artifacts executable
Expand Down
17 changes: 7 additions & 10 deletions .github/actions/artifact_upload/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: "Upload Artifacts"
description: "Upload build Result Binaries"
inputs:
profile:
description: "debug/release"
required: true
sha:
description: "git sha"
required: true
Expand Down Expand Up @@ -36,21 +33,21 @@ runs:
if: steps.info.outputs.src == 'github'
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.profile }}-${{ inputs.sha }}-${{ inputs.target }}-${{ inputs.category }}
path: ./target/${{ inputs.target }}/${{ inputs.profile }}/databend-*
name: ${{ env.BUILD_PROFILE }}-${{ inputs.sha }}-${{ inputs.target }}-${{ inputs.category }}
path: ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/databend-*

- name: Upload open-sharing to github
if: steps.info.outputs.src == 'github'
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.profile }}-${{ inputs.sha }}-${{ inputs.target }}-${{ inputs.category }}
path: ./target/${{ inputs.target }}/${{ inputs.profile }}/open-sharing
name: ${{ env.BUILD_PROFILE }}-${{ inputs.sha }}-${{ inputs.target }}-${{ inputs.category }}
path: ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/open-sharing

- name: Upload artifacts to s3
if: steps.info.outputs.src == 's3'
shell: bash
run: |
aws s3 sync ./target/${{ inputs.target }}/${{ inputs.profile }}/ \
s3://databend-ci/${{ inputs.profile }}/${{ inputs.sha }}/${{ inputs.target }}/${{ inputs.category }}/ \
aws s3 sync ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/ \
s3://databend-ci/${{ env.BUILD_PROFILE }}/${{ inputs.sha }}/${{ inputs.target }}/${{ inputs.category }}/ \
--exclude "*" --include "databend-*" --no-progress
aws s3 cp ./target/${{ inputs.target }}/${{ inputs.profile }}/open-sharing s3://databend-ci/${{ inputs.profile }}/${{ inputs.sha }}/${{ inputs.target }}/${{ inputs.category }}/ --no-progress || true
aws s3 cp ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/open-sharing s3://databend-ci/${{ env.BUILD_PROFILE }}/${{ inputs.sha }}/${{ inputs.target }}/${{ inputs.category }}/ --no-progress || true
16 changes: 6 additions & 10 deletions .github/actions/build_linux/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: "Build Linux"
description: "Build with profile"
inputs:
profile:
description: "debug/release"
required: true
target:
description: ""
required: true
Expand All @@ -21,12 +18,12 @@ runs:
bypass_env_vars: RUSTFLAGS,RUST_LOG

- name: Build Debug
if: inputs.profile == 'debug'
if: env.BUILD_PROFILE == 'debug'
shell: bash
run: cargo build --target ${{ inputs.target }}
run: cargo build --target ${{ inputs.target }} --timings

- name: Set Release build flags
if: inputs.profile == 'release'
if: env.BUILD_PROFILE == 'release'
shell: bash
run: |
case ${{ inputs.target }} in
Expand All @@ -51,15 +48,15 @@ runs:
echo "BUILD_ARCH=${target/-unknown-linux-*}" >> $GITHUB_ENV
- name: Build Release
if: inputs.profile == 'release'
if: env.BUILD_PROFILE == 'release'
shell: bash
run: cargo build --target ${{ inputs.target }} --release

# - shell: bash
# run: readelf -p .comment ./target/${{ inputs.target }}/${{ inputs.profile }}/databend-query
# run: readelf -p .comment ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/databend-query

- name: Copyobj zlib for gnu binaries
if: inputs.profile == 'release' && endsWith(inputs.target, '-gnu')
if: env.BUILD_PROFILE == 'release' && endsWith(inputs.target, '-gnu')
shell: bash
run: |
build-tool /usr/bin/${{ env.BUILD_ARCH }}-linux-gnu-objcopy --compress-debug-sections=zlib-gnu ./target/${{ inputs.target }}/release/databend-query
Expand All @@ -70,6 +67,5 @@ runs:
if: inputs.upload == 'true'
uses: ./.github/actions/artifact_upload
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}
10 changes: 3 additions & 7 deletions .github/actions/build_linux_hive/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ inputs:
target:
description: ""
required: true
profile:
description: "debug/release"
required: true
runs:
using: "composite"
steps:
Expand All @@ -16,22 +13,21 @@ runs:
target: ${{ inputs.target }}

- name: Build Debug
if: inputs.profile == 'debug'
if: env.BUILD_PROFILE == 'debug'
shell: bash
run: cargo build --target ${{ inputs.target }} --features hive

- name: Build Release
if: inputs.profile == 'release'
if: env.BUILD_PROFILE == 'release'
shell: bash
run: cargo build --target ${{ inputs.target }} --features hive --release

# - shell: bash
# run: readelf -p .comment ./target/${{ inputs.target }}/${{ inputs.profile }}/databend-query
# run: readelf -p .comment ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/databend-query

- name: Upload artifact
uses: ./.github/actions/artifact_upload
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}
category: hive
8 changes: 2 additions & 6 deletions .github/actions/build_macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ inputs:
target:
description: ""
required: true
profile:
description: "debug/release"
required: true
runs:
using: "composite"
steps:
Expand All @@ -17,18 +14,17 @@ runs:
rustup target add ${{ inputs.target }}
- name: Build Debug
if: inputs.profile == 'debug'
if: env.BUILD_PROFILE == 'debug'
shell: bash
run: cargo build --target ${{ inputs.target }}

- name: Build Release
if: inputs.profile == 'release'
if: env.BUILD_PROFILE == 'release'
shell: bash
run: cargo build --target ${{ inputs.target }} --release

- name: Upload artifact
uses: ./.github/actions/artifact_upload
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}
5 changes: 0 additions & 5 deletions .github/actions/fuse_compat/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Test fuse-table format in an old query is compatible with new query"
description: "Download old binaries and current binaries, write data with old query, read data with new query"
inputs:
profile:
description: ""
required: true
default: "debug"
target:
description: ""
required: true
Expand All @@ -15,7 +11,6 @@ runs:
- name: Download artifact
uses: ./.github/actions/artifact_download
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}
path: ./bins/current
Expand Down
5 changes: 0 additions & 5 deletions .github/actions/test_compat/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Test old metasrv is compatible with new query"
description: "Download old binaries and current binaries, run stateless test with old `meta` and latest `query`"
inputs:
profile:
description: ""
required: true
default: "debug"
target:
description: ""
required: true
Expand All @@ -15,7 +11,6 @@ runs:
- name: Download artifact
uses: ./.github/actions/artifact_download
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}
path: ./bins/current
Expand Down
5 changes: 0 additions & 5 deletions .github/actions/test_fuzz_standalone_linux/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Test Fuzz Standalone"
description: "Running fuzz tests in standalone mode"
inputs:
profile:
description: "The profile for this test"
required: true
default: "debug"
target:
description: ""
required: true
Expand All @@ -15,7 +11,6 @@ runs:
- name: Download artifact
uses: ./.github/actions/artifact_download
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}

Expand Down
5 changes: 0 additions & 5 deletions .github/actions/test_meta-upgrade-09/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Test meta-upgrade-09"
description: ""
inputs:
profile:
description: "The profile for this test"
required: true
default: "debug"
target:
description: ""
required: true
Expand All @@ -15,7 +11,6 @@ runs:
- name: Download artifact
uses: ./.github/actions/artifact_download
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}

Expand Down
5 changes: 0 additions & 5 deletions .github/actions/test_meta_cluster/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Test databend-meta cluster"
description: "Download binaries, setup cluster by joining and leaving"
inputs:
profile:
description: ""
required: true
default: "debug"
target:
description: ""
required: true
Expand All @@ -15,7 +11,6 @@ runs:
- name: Download artifact
uses: ./.github/actions/artifact_download
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}

Expand Down
5 changes: 0 additions & 5 deletions .github/actions/test_meta_data_compat_openraft_07/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Test meta data compatibility with openraft-07"
description: ""
inputs:
profile:
description: "The profile for this test"
required: true
default: "debug"
target:
description: ""
required: true
Expand All @@ -15,7 +11,6 @@ runs:
- name: Download artifact
uses: ./.github/actions/artifact_download
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}

Expand Down
5 changes: 0 additions & 5 deletions .github/actions/test_metactl/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Test metactl"
description: ""
inputs:
profile:
description: "The profile for this test"
required: true
default: "debug"
target:
description: ""
required: true
Expand All @@ -15,7 +11,6 @@ runs:
- name: Download artifact
uses: ./.github/actions/artifact_download
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}

Expand Down
5 changes: 0 additions & 5 deletions .github/actions/test_sqllogic_cluster_linux/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Test sqllogic Cluster Linux"
description: "Running sqllogic tests in cluster mode"
inputs:
profile:
description: "The profile for this test"
required: true
default: "debug"
target:
description: ""
required: true
Expand All @@ -23,7 +19,6 @@ runs:
- name: Download artifact
uses: ./.github/actions/artifact_download
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}
- name: Run sqllogic Tests with Cluster mode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Test sqllogic management mode"
description: "Running sqllogic tests in management mode"
inputs:
profile:
description: "The profile for this test"
required: true
default: "debug"
target:
description: ""
required: true
Expand All @@ -23,7 +19,6 @@ runs:
- name: Download artifact
uses: ./.github/actions/artifact_download
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}
- name: Run sqllogic Tests with management mode
Expand Down
5 changes: 0 additions & 5 deletions .github/actions/test_sqllogic_standalone_linux/action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: "Test sqllogic Standalone"
description: "Running sqllogic tests in standalone mode"
inputs:
profile:
description: "The profile for this test"
required: true
default: "debug"
target:
description: ""
required: true
Expand All @@ -28,7 +24,6 @@ runs:
- name: Download artifact
uses: ./.github/actions/artifact_download
with:
profile: ${{ inputs.profile }}
sha: ${{ github.sha }}
target: ${{ inputs.target }}
- name: Run sqllogic Tests with Standalone mode
Expand Down
Loading

1 comment on commit e8e9079

@vercel
Copy link

@vercel vercel bot commented on e8e9079 Apr 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

databend – ./

databend.vercel.app
databend-git-main-databend.vercel.app
databend-databend.vercel.app
databend.rs

Please sign in to comment.