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
|
2023-09-08 06:42:56 +00:00
|
|
|
fetch-depth: 0 # to find ancestor merge commits necessary for finding proper docker tags
|
2023-09-20 19:22:53 +00:00
|
|
|
filter: tree:0
|
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
|
2023-05-10 11:30:39 +00:00
|
|
|
Codebrowser:
|
|
|
|
needs: [DockerHubPush]
|
|
|
|
uses: ./.github/workflows/woboq.yml
|
2022-10-26 18:07:10 +00:00
|
|
|
SonarCloud:
|
|
|
|
runs-on: [self-hosted, builder]
|
|
|
|
env:
|
2023-04-13 14:48:45 +00:00
|
|
|
SONAR_SCANNER_VERSION: 4.8.0.2856
|
2022-10-26 18:07:10 +00:00
|
|
|
SONAR_SERVER_URL: "https://sonarcloud.io"
|
|
|
|
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
|
2023-08-24 18:03:22 +00:00
|
|
|
CC: clang-17
|
|
|
|
CXX: clang++-17
|
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
|
2023-10-17 17:21:08 +00:00
|
|
|
filter: tree:0
|
2022-10-26 18:07:10 +00:00
|
|
|
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
|
2023-06-30 14:53:04 +00:00
|
|
|
sudo apt-get install -yq git cmake ccache ninja-build python3 yasm nasm
|
2022-10-26 18:07:10 +00:00
|
|
|
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" \
|
2023-06-30 14:41:31 +00:00
|
|
|
--define sonar.cfamily.cpp23.enabled=true \
|
|
|
|
--define sonar.exclusions="**/*.java,**/*.ts,**/*.js,**/*.css,**/*.sql"
|