nightly #800
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Workflow: Nightly ShannonBase Compile & MTR | |
| # Purpose: Builds and tests ShannonBase (MySQL-based project) on x86 and ARM architectures | |
| # Triggers: | |
| # - Push to tags matching "*v*" (e.g., version tags like v1.0.0) | |
| # - Daily at 1:30 AM Beijing time (UTC+8, equivalent to 5:30 PM UTC previous day) | |
| # - Manual dispatch via workflow_dispatch | |
| # Jobs: | |
| # - lint: Checks code formatting for storage/rapid_engine and ml directories | |
| # - build_x86: Builds and runs selected MTR tests on x86 architecture | |
| # - build_arm: Builds and runs selected MTR tests on ARM architecture with skip-test list | |
| # Notes: | |
| # - Uses concurrency to cancel in-progress runs for the same workflow/ref | |
| # - Includes disk space optimizations to prevent 'No space left on device' errors | |
| # - Commented-out alternative test commands (collections/default.push, default.daily) for future use with faster runners | |
| # - lint job may fail on non-PR events due to pull_request-specific variables; needs adjustment for tag push and schedule triggers | |
| # | |
| # Copyright (c) 2023, 2024, 2025 Shannon Data AI and/or its affiliates. | |
| name: nightly | |
| on: | |
| push: | |
| tags: | |
| - "*v*" | |
| schedule: | |
| - cron: "30 4 * * *" | |
| timezone: "Asia/Shanghai" | |
| concurrency: | |
| group: nightly | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| PROTOC: protoc | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true # Add this to Node24 | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| lint: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Ensure clang-format is available | |
| run: | | |
| command -v clang-format-14 > /dev/null || (sudo apt-get update && sudo apt-get install -y clang-format-14) | |
| - name: Format check | |
| run: | | |
| git diff -U0 --no-color ${{ github.event.pull_request.base.sha }} HEAD storage/rapid_engine ml | /usr/share/clang/clang-format-14/clang-format-diff.py -p1 | tee /tmp/.clang-format-diff | |
| [ -s /tmp/.clang-format-diff ] && exit 1 || true | |
| # x86 | |
| build_x86: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Clean old build cache | |
| run: | | |
| rm -rf ${{ github.workspace }}/cmake_build | |
| - name: install_lib | |
| run: | | |
| sudo apt update -y | |
| sudo apt install -y libtirpc-dev && sudo apt install -y libboost-all-dev libexpect-perl | |
| - name: Download models | |
| run: | | |
| pip install -q huggingface_hub | |
| hf download shannondata/multilingual-e5-small \ | |
| --local-dir ${{ github.workspace }}/extra/llm-models/multilingual-e5-small | |
| - name: build_shannon_and_install | |
| run: | | |
| cd ${{ github.workspace }} | |
| mkdir cmake_build && cd cmake_build | |
| sudo mkdir -p /home/shannon-bin && sudo mkdir -p /home/shannon-bin/data | |
| sudo chown -R $USER:$USER /home/shannon-bin/ | |
| git config --global --add safe.directory ${{ github.workspace }} | |
| git fetch --tags -f | |
| cmake ../ \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_INSTALL_PREFIX=/home/shannon-bin/ \ | |
| -DMYSQL_DATADIR=/home/shannon-bin/data \ | |
| -DSYSCONFDIR=/home/shannon-bin/ \ | |
| -DMYSQL_UNIX_ADDR=/home/shannon-bin/temp/mysql.sock \ | |
| -DWITH_MYISAM_STORAGE_ENGINE=1 \ | |
| -DWITH_INNOBASE_STORAGE_ENGINE=1 \ | |
| -DMYSQL_TCP_PORT=3306 \ | |
| -DENABLED_LOCAL_INFILE=1 \ | |
| -DWITH_PROTOBUF=bundled \ | |
| -DWITH_CURL=bundled \ | |
| -DWITH_UNIT_TESTS=ON \ | |
| -DWITH_HYPERGRAPH_OPTIMIZER=ON \ | |
| -DCOMPILATION_COMMENT="MySQL Community Server, and Shannon Data AI Alpha V." | |
| make -j"$(nproc)" && sudo make install | |
| sudo find /home/shannon-bin/bin -type f -executable -exec strip --strip-unneeded {} \; || true | |
| - name: clean_up_shannonbase_build | |
| run: | | |
| sudo rm -rf ${{ github.workspace }}/* | |
| sudo apt-get clean -y | |
| sudo apt-get autoremove -y --purge | |
| sudo rm -rf /var/lib/apt/lists/* | |
| sudo rm -rf /var/log/* /var/cache/* | |
| sudo rm -rf /tmp/* /var/tmp/* | |
| sudo rm -rf ~/.cache/* ~/.npm/* ~/.gem/* | |
| sudo rm -rf /home/runner/.cache/* /home/runner/.docker/* | |
| - name: run_mtr_test | |
| run: | | |
| sudo mkdir -p /home/shannon-bin/log | |
| sudo chown -R $USER:$USER /home/shannon-bin/ | |
| cd /home/shannon-bin/mysql-test/ | |
| sudo chmod -R u+rwx mysql-test-run.pl | |
| ./mysql-test-run.pl --mysqld=--loose-rapid_schema_embedding=OFF --suite=main,innodb,innodb_zip,federated,clone,rpl,rpl_ndb,rpl_gtid,rpl_nogtid,\ | |
| funcs_1,funcs_2,information_schema,sys_vars,opt_trace,secondary_engine,ml,sysschema,perfschema \ | |
| --big-test --mysqld=--user=$USER --mysqld=--default-storage-engine=innodb --nowarnings --force --nocheck-testcases --retry=3 --parallel=$(nproc) | |
| # binlog,binlog_gtid,binlog_nogtid, due to disk space limition on github runner, when we have a fast git action runner, we can use the following command to run the test. | |
| #sudo chmod +x ./collections/default.push && ./collections/default.daily | |
| # ARM | |
| build_arm: | |
| needs: lint | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Clean old build cache | |
| run: | | |
| rm -rf ${{ github.workspace }}/cmake_build | |
| - name: Install ARM dependencies | |
| run: | | |
| sudo apt update -y | |
| sudo apt install -y libtirpc-dev libboost-all-dev libjson-perl libexpect-perl | |
| - name: Download models | |
| run: | | |
| pip install -q huggingface_hub | |
| hf download shannondata/multilingual-e5-small \ | |
| --local-dir ${{ github.workspace }}/extra/llm-models/multilingual-e5-small | |
| - name: Build and install (ARM) | |
| run: | | |
| cd ${{ github.workspace }} | |
| mkdir cmake_build && cd cmake_build | |
| sudo mkdir -p /home/shannon-bin && sudo mkdir -p /home/shannon-bin/data | |
| sudo chown -R $USER:$USER /home/shannon-bin/ | |
| git config --global --add safe.directory ${{ github.workspace }} | |
| git fetch --tags -f | |
| cmake ../ \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_INSTALL_PREFIX=/home/shannon-bin/ \ | |
| -DMYSQL_DATADIR=/home/shannon-bin/data \ | |
| -DSYSCONFDIR=/home/shannon-bin/ \ | |
| -DMYSQL_UNIX_ADDR=/home/shannon-bin/temp/mysql.sock \ | |
| -DWITH_MYISAM_STORAGE_ENGINE=1 \ | |
| -DWITH_INNOBASE_STORAGE_ENGINE=1 \ | |
| -DMYSQL_TCP_PORT=3306 \ | |
| -DENABLED_LOCAL_INFILE=1 \ | |
| -DWITH_PROTOBUF=bundled \ | |
| -DWITH_CURL=bundled \ | |
| -DWITH_UNIT_TESTS=ON \ | |
| -DWITH_HYPERGRAPH_OPTIMIZER=ON \ | |
| -DCMAKE_C_FLAGS="-march=armv8-a -O2" \ | |
| -DCMAKE_CXX_FLAGS="-march=armv8-a -O2" \ | |
| -DCOMPILATION_COMMENT="MySQL Community Server, and Shannon Data AI Alpha V." | |
| make -j"$(nproc)" && sudo make install | |
| sudo find /home/shannon-bin/bin -type f -executable -exec strip --strip-unneeded {} \; || true | |
| - name: Clean up build | |
| run: | | |
| sudo rm -rf ${{ github.workspace }}/* | |
| sudo apt-get clean -y | |
| sudo apt-get autoremove -y --purge | |
| sudo rm -rf /var/lib/apt/lists/* | |
| sudo rm -rf /var/log/* /var/cache/* | |
| sudo rm -rf /tmp/* /var/tmp/* | |
| sudo rm -rf ~/.cache/* ~/.npm/* ~/.gem/* | |
| sudo rm -rf /home/runner/.cache/* /home/runner/.docker/* | |
| - name: Run MTR tests (ARM) | |
| run: | | |
| sudo mkdir -p /home/shannon-bin/log | |
| sudo chown -R $USER:$USER /home/shannon-bin/ | |
| cd /home/shannon-bin/mysql-test/ | |
| sudo chmod -R u+rwx mysql-test-run.pl | |
| ./mysql-test-run.pl --mysqld=--loose-rapid_schema_embedding=OFF --suite=main,clone,innodb,innodb_zip,rpl,rpl_ndb,rpl_gtid,rpl_nogtid,binlog,\ | |
| binlog_gtid,binlog_nogtid,secondary_engine,ml,sysschema,perfschema \ | |
| --big-test --mysqld=--user=$USER --mysqld=--default-storage-engine=innodb --nowarnings --force --nocheck-testcases --skip-test-list=skip-tests.arm --retry=3 --parallel=$(nproc) | |
| # when we have a fast git action runner, we can use the following command to run the test. | |
| #sudo chmod +x ./collections/default.push && ./collections/default.daily |