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
|
2023-12-18 08:07:22 +00:00
|
|
|
RunConfig:
|
2024-02-21 16:59:41 +00:00
|
|
|
runs-on: [self-hosted, style-checker-aarch64]
|
2023-12-18 08:07:22 +00:00
|
|
|
outputs:
|
|
|
|
data: ${{ steps.runconfig.outputs.CI_DATA }}
|
2022-02-10 10:44:50 +00:00
|
|
|
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:
|
2023-12-18 08:07:22 +00:00
|
|
|
clear-repository: true # to ensure correct digests
|
2023-12-18 16:06:10 +00:00
|
|
|
fetch-depth: 0 # to get version
|
|
|
|
filter: tree:0
|
2023-12-18 08:07:22 +00:00
|
|
|
- name: PrepareRunConfig
|
|
|
|
id: runconfig
|
2022-02-10 10:44:50 +00:00
|
|
|
run: |
|
2023-12-18 08:07:22 +00:00
|
|
|
echo "::group::configure CI run"
|
2024-02-05 17:09:43 +00:00
|
|
|
python3 "$GITHUB_WORKSPACE/tests/ci/ci.py" --configure --skip-jobs --outfile ${{ runner.temp }}/ci_run_data.json
|
2023-12-18 08:07:22 +00:00
|
|
|
echo "::endgroup::"
|
|
|
|
|
|
|
|
echo "::group::CI run configure results"
|
|
|
|
python3 -m json.tool ${{ runner.temp }}/ci_run_data.json
|
|
|
|
echo "::endgroup::"
|
|
|
|
{
|
|
|
|
echo 'CI_DATA<<EOF'
|
|
|
|
cat ${{ runner.temp }}/ci_run_data.json
|
|
|
|
echo 'EOF'
|
|
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
BuildDockers:
|
|
|
|
needs: [RunConfig]
|
|
|
|
uses: ./.github/workflows/reusable_docker.yml
|
|
|
|
with:
|
|
|
|
data: "${{ needs.RunConfig.outputs.data }}"
|
|
|
|
set_latest: true
|
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"
|