Development hananiah #222
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
| name: C/C++ CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository(with submodules over SSH) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 1 | |
| ssh-key: ${{ secrets.ALICE_DEPLOY_KEY }} | |
| - name: Ensure submodules are initialized | |
| run: | | |
| git submodule sync --recursive | |
| git submodule update --init --recursive --depth 1 | |
| git submodule status | |
| git submodule foreach --recursive 'echo "== $name =="; git remote -v' | |
| - name: Install Qt5 (Ubuntu) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| qtbase5-dev qtbase5-dev-tools qtbase5-private-dev qt5-qmake \ | |
| qttools5-dev qttools5-dev-tools \ | |
| libqt5svg5-dev\ | |
| qtdeclarative5-dev \ | |
| qtquickcontrols2-5-dev\ | |
| python3 \ | |
| uuid-dev \ | |
| build-essential ninja-build rsync pkg-config curl \ | |
| libgl1-mesa-dev libglu1-mesa-dev xorg-dev | |
| - name: Build OCCT SDK (Linux) | |
| run: | | |
| set -e | |
| # 防止 Windows 提交的 CRLF 让 Ubuntu 解释器看到 "sh\r" / "bash\r" | |
| # (当前 CI 报错就是这个原因:/usr/bin/env: 'sh\r': No such file or directory) | |
| if [ -d "AliceThirdParty/scripts" ]; then | |
| find AliceThirdParty/scripts -maxdepth 1 -name "*.sh" -print0 | xargs -0 sed -i 's/\r$//' | |
| chmod +x AliceThirdParty/scripts/*.sh | |
| fi | |
| # If OCCT SDK is not present in the repo snapshot, build it in CI and export into Externals/3rdParty. | |
| if [ ! -f "Externals/3rdParty/sdk/linux-x64/Release/occt/lib/cmake/opencascade/OpenCASCADEConfig.cmake" ] && \ | |
| [ ! -f "Externals/3rdParty/sdk/linux-x64/Release/occt/cmake/OpenCASCADEConfig.cmake" ]; then | |
| bash AliceThirdParty/scripts/build-occt.sh Release x64-linux | |
| bash AliceThirdParty/scripts/export-occt-sdk.sh Release "$GITHUB_WORKSPACE" | |
| else | |
| echo "OCCT SDK already exists in Externals/3rdParty/sdk/linux-x64/Release/occt" | |
| fi | |
| - name: Configure with CMake (headless) | |
| run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DSD_BUILD_DESIGNER=ON -DSD_BUILD_DEMOS=ON -DQt5_DIR=/usr/lib/x86_64-linux-gnu/cmake/Qt5 | |
| - name: Build | |
| run: cmake --build build --config Release --parallel |