2022-02-10 10:44:50 +00:00
|
|
|
name: NightlyBuilds
|
|
|
|
|
|
|
|
env:
|
|
|
|
# Force the stdout and stderr streams to be unbuffered
|
|
|
|
PYTHONUNBUFFERED: 1
|
|
|
|
|
|
|
|
"on":
|
|
|
|
schedule:
|
2022-02-14 00:24:42 +00:00
|
|
|
- cron: '13 3 * * *'
|
2022-03-23 14:26:22 +00:00
|
|
|
workflow_dispatch:
|
2022-02-10 10:44:50 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-11-07 10:40:18 +00:00
|
|
|
Debug:
|
|
|
|
# The task for having a preserved ENV and event.json for later investigation
|
|
|
|
uses: ./.github/workflows/debug.yml
|
2022-02-10 10:44:50 +00:00
|
|
|
DockerHubPushAarch64:
|
|
|
|
runs-on: [self-hosted, style-checker-aarch64]
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
2022-12-23 16:54:19 +00:00
|
|
|
uses: ClickHouse/checkout@v1
|
2022-12-20 10:14:42 +00:00
|
|
|
with:
|
|
|
|
clear-repository: true
|
2022-02-10 10:44:50 +00:00
|
|
|
- name: Images check
|
|
|
|
run: |
|
|
|
|
cd "$GITHUB_WORKSPACE/tests/ci"
|
|
|
|
python3 docker_images_check.py --suffix aarch64 --all
|
|
|
|
- name: Upload images files to artifacts
|
2022-12-19 20:02:35 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-02-10 10:44:50 +00:00
|
|
|
with:
|
|
|
|
name: changed_images_aarch64
|
|
|
|
path: ${{ runner.temp }}/docker_images_check/changed_images_aarch64.json
|
|
|
|
DockerHubPushAmd64:
|
|
|
|
runs-on: [self-hosted, style-checker]
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
2022-12-23 16:54:19 +00:00
|
|
|
uses: ClickHouse/checkout@v1
|
2022-12-20 10:14:42 +00:00
|
|
|
with:
|
|
|
|
clear-repository: true
|
2022-02-10 10:44:50 +00:00
|
|
|
- name: Images check
|
|
|
|
run: |
|
|
|
|
cd "$GITHUB_WORKSPACE/tests/ci"
|
|
|
|
python3 docker_images_check.py --suffix amd64 --all
|
|
|
|
- name: Upload images files to artifacts
|
2022-12-19 20:02:35 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-02-10 10:44:50 +00:00
|
|
|
with:
|
|
|
|
name: changed_images_amd64
|
|
|
|
path: ${{ runner.temp }}/docker_images_check/changed_images_amd64.json
|
|
|
|
DockerHubPush:
|
|
|
|
needs: [DockerHubPushAmd64, DockerHubPushAarch64]
|
|
|
|
runs-on: [self-hosted, style-checker]
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
2022-12-23 16:54:19 +00:00
|
|
|
uses: ClickHouse/checkout@v1
|
2022-12-20 10:14:42 +00:00
|
|
|
with:
|
|
|
|
clear-repository: true
|
2022-02-10 10:44:50 +00:00
|
|
|
- name: Download changed aarch64 images
|
2022-12-19 20:02:35 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2022-02-10 10:44:50 +00:00
|
|
|
with:
|
|
|
|
name: changed_images_aarch64
|
|
|
|
path: ${{ runner.temp }}
|
|
|
|
- name: Download changed amd64 images
|
2022-12-19 20:02:35 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2022-02-10 10:44:50 +00:00
|
|
|
with:
|
|
|
|
name: changed_images_amd64
|
|
|
|
path: ${{ runner.temp }}
|
|
|
|
- name: Images check
|
|
|
|
run: |
|
|
|
|
cd "$GITHUB_WORKSPACE/tests/ci"
|
|
|
|
python3 docker_manifests_merge.py --suffix amd64 --suffix aarch64
|
|
|
|
- name: Upload images files to artifacts
|
2022-12-19 20:02:35 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-02-10 10:44:50 +00:00
|
|
|
with:
|
|
|
|
name: changed_images
|
|
|
|
path: ${{ runner.temp }}/changed_images.json
|
2022-03-14 13:51:50 +00:00
|
|
|
BuilderCoverity:
|
|
|
|
needs: DockerHubPush
|
|
|
|
runs-on: [self-hosted, builder]
|
|
|
|
steps:
|
|
|
|
- name: Set envs
|
|
|
|
run: |
|
|
|
|
cat >> "$GITHUB_ENV" << 'EOF'
|
2022-04-07 16:21:13 +00:00
|
|
|
BUILD_NAME=coverity
|
2022-03-14 13:51:50 +00:00
|
|
|
CACHES_PATH=${{runner.temp}}/../ccaches
|
2022-04-07 16:21:13 +00:00
|
|
|
IMAGES_PATH=${{runner.temp}}/images_path
|
|
|
|
REPO_COPY=${{runner.temp}}/build_check/ClickHouse
|
|
|
|
TEMP_PATH=${{runner.temp}}/build_check
|
2022-03-14 13:51:50 +00:00
|
|
|
EOF
|
2022-04-07 16:21:13 +00:00
|
|
|
echo "COVERITY_TOKEN=${{ secrets.COVERITY_TOKEN }}" >> "$GITHUB_ENV"
|
2022-03-14 13:51:50 +00:00
|
|
|
- name: Download changed images
|
2022-12-19 20:02:35 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2022-03-14 13:51:50 +00:00
|
|
|
with:
|
|
|
|
name: changed_images
|
|
|
|
path: ${{ env.IMAGES_PATH }}
|
|
|
|
- name: Check out repository code
|
2022-12-23 16:54:19 +00:00
|
|
|
uses: ClickHouse/checkout@v1
|
2022-03-14 13:51:50 +00:00
|
|
|
with:
|
2022-12-20 10:14:42 +00:00
|
|
|
clear-repository: true
|
|
|
|
submodules: true
|
2022-03-14 13:51:50 +00:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
sudo rm -fr "$TEMP_PATH"
|
|
|
|
mkdir -p "$TEMP_PATH"
|
|
|
|
cp -r "$GITHUB_WORKSPACE" "$TEMP_PATH"
|
2022-06-01 14:41:27 +00:00
|
|
|
cd "$REPO_COPY/tests/ci" && python3 build_check.py "$BUILD_NAME"
|
2022-03-14 13:51:50 +00:00
|
|
|
- name: Upload Coverity Analysis
|
|
|
|
if: ${{ success() || failure() }}
|
|
|
|
run: |
|
2022-04-07 16:21:13 +00:00
|
|
|
curl --form token="${COVERITY_TOKEN}" \
|
|
|
|
--form email='security+coverity@clickhouse.com' \
|
2022-04-10 20:01:37 +00:00
|
|
|
--form file="@$TEMP_PATH/$BUILD_NAME/coverity-scan.tgz" \
|
2022-03-14 13:51:50 +00:00
|
|
|
--form version="${GITHUB_REF#refs/heads/}-${GITHUB_SHA::6}" \
|
|
|
|
--form description="Nighly Scan: $(date +'%Y-%m-%dT%H:%M:%S')" \
|
|
|
|
https://scan.coverity.com/builds?project=ClickHouse%2FClickHouse
|
|
|
|
- name: Cleanup
|
|
|
|
if: always()
|
|
|
|
run: |
|
2022-09-17 18:24:56 +00:00
|
|
|
docker ps --quiet | xargs --no-run-if-empty docker kill ||:
|
|
|
|
docker ps --all --quiet | xargs --no-run-if-empty docker rm -f ||:
|
2022-03-14 13:51:50 +00:00
|
|
|
sudo rm -fr "$TEMP_PATH" "$CACHES_PATH"
|
2022-10-26 18:07:10 +00:00
|
|
|
SonarCloud:
|
|
|
|
runs-on: [self-hosted, builder]
|
|
|
|
env:
|
|
|
|
SONAR_SCANNER_VERSION: 4.7.0.2747
|
|
|
|
SONAR_SERVER_URL: "https://sonarcloud.io"
|
|
|
|
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
|
2022-10-31 18:11:52 +00:00
|
|
|
CC: clang-15
|
|
|
|
CXX: clang++-15
|
2022-10-26 18:07:10 +00:00
|
|
|
steps:
|
2022-12-20 10:14:42 +00:00
|
|
|
- name: Check out repository code
|
2022-12-23 16:54:19 +00:00
|
|
|
uses: ClickHouse/checkout@v1
|
2022-10-26 18:07:10 +00:00
|
|
|
with:
|
2022-12-20 10:14:42 +00:00
|
|
|
clear-repository: true
|
2022-10-26 18:07:10 +00:00
|
|
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
|
|
|
submodules: true
|
|
|
|
- name: Set up JDK 11
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: 11
|
|
|
|
- name: Download and set up sonar-scanner
|
|
|
|
env:
|
|
|
|
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
|
2022-10-28 17:47:37 +00:00
|
|
|
run: |
|
2022-10-28 18:17:29 +00:00
|
|
|
mkdir -p "$HOME/.sonar"
|
|
|
|
curl -sSLo "$HOME/.sonar/sonar-scanner.zip" "${{ env.SONAR_SCANNER_DOWNLOAD_URL }}"
|
|
|
|
unzip -o "$HOME/.sonar/sonar-scanner.zip" -d "$HOME/.sonar/"
|
|
|
|
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> "$GITHUB_PATH"
|
2022-10-26 18:07:10 +00:00
|
|
|
- name: Download and set up build-wrapper
|
|
|
|
env:
|
|
|
|
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip
|
2022-10-28 17:47:37 +00:00
|
|
|
run: |
|
2022-10-31 15:02:08 +00:00
|
|
|
curl -sSLo "$HOME/.sonar/build-wrapper-linux-x86.zip" "${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}"
|
2022-10-28 18:17:29 +00:00
|
|
|
unzip -o "$HOME/.sonar/build-wrapper-linux-x86.zip" -d "$HOME/.sonar/"
|
|
|
|
echo "$HOME/.sonar/build-wrapper-linux-x86" >> "$GITHUB_PATH"
|
2022-10-26 18:07:10 +00:00
|
|
|
- name: Set Up Build Tools
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -yq git cmake ccache python3 ninja-build
|
|
|
|
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
|
|
|
|
- name: Run build-wrapper
|
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake ..
|
|
|
|
cd ..
|
|
|
|
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/
|
|
|
|
- name: Run sonar-scanner
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
|
|
run: |
|
|
|
|
sonar-scanner \
|
|
|
|
--define sonar.host.url="${{ env.SONAR_SERVER_URL }}" \
|
|
|
|
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
|
|
|
|
--define sonar.projectKey="ClickHouse_ClickHouse" \
|
2022-10-31 20:53:58 +00:00
|
|
|
--define sonar.organization="clickhouse-java" \
|
2022-10-31 21:58:43 +00:00
|
|
|
--define sonar.exclusions="**/*.java,**/*.ts,**/*.js,**/*.css,**/*.sql"
|