Project: move generated project_info.h to the project build directory #1211
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: Debug | |
| on: | |
| push: | |
| paths-ignore: | |
| - "**/*.md" | |
| - "docs/**" | |
| pull_request: | |
| paths-ignore: | |
| - "**/*.md" | |
| - "docs/**" | |
| merge_group: | |
| paths-ignore: | |
| - "**/*.md" | |
| - "docs/**" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: ${{ matrix.config.name }} | |
| env: | |
| QtLatestVersion: &QtLatest "6.10.1" | |
| QtBrewVersion: &QtBrew "6.9.3" | |
| QtMinimalVersion: &QtMinimal "5.12.0" | |
| needs: [build-riscv-tests, build-stud-support-tests] | |
| # Avoid duplicate builds on PR from the same repository | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
| runs-on: ${{ matrix.config.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| # Linux testing | |
| - { | |
| name: "Ubuntu latest (GCC) + packaged Qt6", | |
| os: ubuntu-latest, | |
| build_type: "Debug", | |
| cc: "gcc", | |
| cxx: "g++", | |
| build_system: "Unix Makefiles", | |
| qt_version: "native", | |
| qt_install_command: "sudo apt-get update && sudo apt-get install qt6-base-dev", | |
| } | |
| - { | |
| name: "Ubuntu latest (GCC) + packaged Qt5", | |
| os: ubuntu-latest, | |
| build_type: "Debug", | |
| cc: "gcc", | |
| cxx: "g++", | |
| build_system: "Unix Makefiles", | |
| qt_version: "native", | |
| qt_install_command: "sudo apt-get update && sudo apt-get install qtbase5-dev", | |
| } | |
| - { | |
| name: "Ubuntu latest (GCC) + latest Qt6", | |
| os: ubuntu-latest, | |
| build_type: "Debug", | |
| cc: "gcc", | |
| cxx: "g++", | |
| build_system: "Unix Makefiles", | |
| qt_version: *QtLatest, | |
| } | |
| - { | |
| name: "Ubuntu oldest (GCC) + minimal supported Qt", | |
| os: ubuntu-22.04, | |
| build_type: "Debug", | |
| cc: "gcc", | |
| cxx: "g++", | |
| build_system: "Unix Makefiles", | |
| qt_version: *QtMinimal, | |
| } | |
| # macOS testing | |
| - { | |
| name: "macOS latest ARM64 (Clang) + Qt6", | |
| os: macos-latest, | |
| build_type: "Debug", | |
| cc: "clang", | |
| cxx: "clang++", | |
| build_system: "Unix Makefiles", | |
| qt_version: *QtBrew, | |
| # Cached aqt is faster that brew. | |
| } | |
| - { | |
| name: "macOS latest AMD64 (Clang) + Qt6", | |
| os: macos-15-intel, | |
| build_type: "Debug", | |
| cc: "clang", | |
| cxx: "clang++", | |
| build_system: "Unix Makefiles", | |
| qt_version: *QtBrew, | |
| # Cached aqt is faster that brew. | |
| } | |
| - { | |
| name: "macOS oldest AMD64 (Clang) + minimal supported Qt", | |
| os: macos-15-intel, | |
| build_type: "Debug", | |
| cc: "clang", | |
| cxx: "clang++", | |
| build_system: "Unix Makefiles", | |
| qt_version: *QtMinimal, | |
| # Cached aqt is faster that brew. | |
| } | |
| # Windows testing | |
| - { | |
| name: "Windows latest (Clang) + Qt6", | |
| os: windows-latest, | |
| build_type: "Debug", | |
| # on Windows, msbuild does not support Clang with GNU-like interface | |
| # and NMake does not support parallel builds | |
| cc: "clang", | |
| cxx: "clang++", | |
| build_system: "Ninja", | |
| qt_version: *QtLatest, | |
| qt_arch: "win64_msvc2022_64", | |
| } | |
| - { | |
| name: "Windows oldest (Clang) + minimal supported Qt", | |
| os: windows-2022, | |
| build_type: "Debug", | |
| # on Windows, msbuild does not support Clang with GNU-like interface | |
| # and NMake does not support parallel builds | |
| cc: "clang", | |
| cxx: "clang++", | |
| build_system: "Ninja", | |
| qt_version: *QtMinimal, | |
| qt_arch: "win64_msvc2017_64", | |
| } | |
| - { | |
| name: "Windows 2022 (MinGW) + Qt5", | |
| os: windows-2022, | |
| build_type: "Debug", | |
| cc: "gcc", | |
| cxx: "g++", | |
| build_system: "Ninja", | |
| # Older Qt releases do not have 64bit mingw release | |
| qt_version: "5.12.9", | |
| qt_arch: "win64_mingw73", | |
| } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: git submodule update --recursive --init | |
| - name: Ccache | |
| uses: hendrikmuhs/ccache-action@v1 | |
| with: | |
| key: ${{ github.ref_name }}-${{ matrix.config.name }} | |
| - name: Install specified Qt version | |
| if: matrix.config.qt_version != 'native' | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: ${{ matrix.config.qt_version }} | |
| cache: true | |
| cache-key-prefix: ${{ runner.os }}-${{ matrix.config.qt_version }}-Qt | |
| arch: ${{ matrix.config.qt_arch }} | |
| dir: ${{ github.workspace }}/Qt | |
| - name: Install native Qt by package manager | |
| if: matrix.config.qt_version == 'native' | |
| run: ${{ matrix.config.qt_install_command }} | |
| - name: Setup Ninja | |
| if: matrix.config.build_system == 'Ninja' | |
| uses: seanmiddleditch/gha-setup-ninja@v6 | |
| - name: Create Build Environment | |
| run: cmake -E make_directory ${{ github.workspace }}/build | |
| - name: Configure CMake | |
| shell: bash | |
| working-directory: ${{github.workspace}}/build | |
| run: 'cmake $GITHUB_WORKSPACE | |
| -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} | |
| -DCMAKE_C_COMPILER=${{ matrix.config.cc }} | |
| -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} | |
| -DCMAKE_C_COMPILER_LAUNCHER=ccache | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
| -DFORCE_COLORED_OUTPUT=true | |
| -G "${{ matrix.config.build_system }}"' | |
| - name: Build | |
| working-directory: ${{ github.workspace }}/build | |
| run: cmake --build . -j4 | |
| - name: Deploy on Windows | |
| if: runner.os == 'Windows' | |
| working-directory: ${{ github.workspace }}/build/target | |
| shell: bash | |
| run: 'windeployqt "${{ github.workspace }}/build/target/qtrvsim_gui.exe"' | |
| - name: Test | |
| working-directory: ${{ github.workspace }}/build | |
| shell: bash | |
| run: ctest --output-on-failure --verbose | |
| - name: Get official RISC-V tests | |
| if: ${{ steps.cache-tests.outputs.cache-hit != 'true' }} | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: riscv-official-tests | |
| path: tests/riscv-official/isa | |
| - name: Official RISC-V tests (single cycle) | |
| # The testing python script does not support Ubuntu 18 | |
| if: matrix.config.os != 'ubuntu-18.04' | |
| working-directory: ${{ github.workspace }}/tests/riscv-official | |
| #run: python qtrvsim_tester.py --no-64 ${{ github.workspace }}/build/target/qtrvsim_cli | |
| run: python qtrvsim_tester.py -M -A ${{ github.workspace }}/build/target/qtrvsim_cli | |
| - name: Official RISC-V tests (pipelined) | |
| # The testing python script does not support Ubuntu 18 | |
| if: matrix.config.os != 'ubuntu-18.04' | |
| working-directory: ${{ github.workspace }}/tests/riscv-official | |
| #run: python qtrvsim_tester.py --no-64 ${{ github.workspace }}/build/target/qtrvsim_cli | |
| run: python qtrvsim_tester.py -M -A --pipeline ${{ github.workspace }}/build/target/qtrvsim_cli | |
| - name: Official RISC-V tests (single cycle, cached) | |
| # The testing python script does not support Ubuntu 18 | |
| if: matrix.config.os != 'ubuntu-18.04' | |
| working-directory: ${{ github.workspace }}/tests/riscv-official | |
| #run: python qtrvsim_tester.py --no-64 ${{ github.workspace }}/build/target/qtrvsim_cli | |
| run: python qtrvsim_tester.py -M -A --cache ${{ github.workspace }}/build/target/qtrvsim_cli | |
| - name: Official RISC-V tests (pipelined, cached) | |
| # The testing python script does not support Ubuntu 18 | |
| if: matrix.config.os != 'ubuntu-18.04' | |
| working-directory: ${{ github.workspace }}/tests/riscv-official | |
| #run: python qtrvsim_tester.py --no-64 ${{ github.workspace }}/build/target/qtrvsim_cli | |
| run: python qtrvsim_tester.py -M -A --pipeline --cache ${{ github.workspace }}/build/target/qtrvsim_cli | |
| - name: Get stud-support tests | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: stud-support-tests-* | |
| path: tests/stud-support | |
| merge-multiple: false | |
| - name: Stud-support tests (GCC RV32) | |
| working-directory: ${{ github.workspace }}/tests/stud-support | |
| run: | | |
| echo "=== Testing with GCC RV32 binaries ===" | |
| python run_tests.py --qtrvsim-cli ${{ github.workspace }}/build/target/qtrvsim_cli --build-dir stud-support-tests-gcc-rv32 --stud-support-path . | |
| python run_tests.py --qtrvsim-cli ${{ github.workspace }}/build/target/qtrvsim_cli --build-dir stud-support-tests-gcc-rv32 --stud-support-path . --pipeline | |
| python run_tests.py --qtrvsim-cli ${{ github.workspace }}/build/target/qtrvsim_cli --build-dir stud-support-tests-gcc-rv32 --stud-support-path . --cache | |
| python run_tests.py --qtrvsim-cli ${{ github.workspace }}/build/target/qtrvsim_cli --build-dir stud-support-tests-gcc-rv32 --stud-support-path . --pipeline --cache | |
| - name: Stud-support tests (Clang RV32) | |
| working-directory: ${{ github.workspace }}/tests/stud-support | |
| run: | | |
| echo "=== Testing with Clang RV32 binaries ===" | |
| python run_tests.py --qtrvsim-cli ${{ github.workspace }}/build/target/qtrvsim_cli --build-dir stud-support-tests-clang-rv32 --stud-support-path . | |
| python run_tests.py --qtrvsim-cli ${{ github.workspace }}/build/target/qtrvsim_cli --build-dir stud-support-tests-clang-rv32 --stud-support-path . --pipeline | |
| python run_tests.py --qtrvsim-cli ${{ github.workspace }}/build/target/qtrvsim_cli --build-dir stud-support-tests-clang-rv32 --stud-support-path . --cache | |
| python run_tests.py --qtrvsim-cli ${{ github.workspace }}/build/target/qtrvsim_cli --build-dir stud-support-tests-clang-rv32 --stud-support-path . --pipeline --cache | |
| - name: Debug info tests (all toolchain variants) | |
| working-directory: ${{ github.workspace }}/tests/stud-support | |
| run: | | |
| echo "=== Debug info tests (GCC RV32) ===" | |
| python test_debuginfo.py --qtrvsim-cli ${{ github.workspace }}/build/target/qtrvsim_cli --build-dir stud-support-tests-gcc-rv32 | |
| echo "=== Debug info tests (Clang RV32) ===" | |
| python test_debuginfo.py --qtrvsim-cli ${{ github.workspace }}/build/target/qtrvsim_cli --build-dir stud-support-tests-clang-rv32 | |
| - name: Store created artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: target-${{ runner.name }} | |
| path: ${{ github.workspace }}/build/target | |
| build-emscripten: | |
| name: ${{ matrix.config.name }} | |
| # Avoid duplicate builds on PR from the same repository | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
| runs-on: ${{ matrix.config.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - { | |
| name: "WASM Linux", | |
| os: ubuntu-latest, | |
| build_type: Release, | |
| qt_arch: wasm_32, | |
| emsdk_version: 1.39.8, | |
| qt_version: 5.15.2, | |
| } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Ccache | |
| uses: hendrikmuhs/ccache-action@v1.2.11 # https://github.com/hendrikmuhs/ccache-action/issues/181 | |
| with: | |
| key: ${{ github.ref_name }}-${{ matrix.config.name }} | |
| - name: Setup EMSDK cache | |
| id: cache-system-libraries | |
| uses: actions/cache@v4 | |
| with: | |
| path: "emsdk-cache" | |
| key: ${{ runner.os }}-${{ matrix.config.emsdk_version }}-${{ matrix.config.qt_version }}-emsdk | |
| - name: Setup emsdk | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: ${{ matrix.config.emsdk_version }} | |
| actions-cache-folder: "emsdk-cache" | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v3 | |
| with: | |
| version: ${{ matrix.config.qt_version }} | |
| cache: true | |
| cache-key-prefix: "wasm-qt" | |
| arch: ${{ matrix.config.qt_arch }} | |
| dir: ${{ github.workspace }}/Qt | |
| - name: Create Build Environment | |
| run: cmake -E make_directory ${{github.workspace}}/build | |
| - name: Configure CMake | |
| working-directory: ${{github.workspace}}/build | |
| run: "emcmake cmake $GITHUB_WORKSPACE | |
| -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} | |
| -DCMAKE_PREFIX_PATH=$Qt5_DIR | |
| -DCMAKE_FIND_ROOT_PATH=$Qt5_DIR | |
| -DCMAKE_C_COMPILER_LAUNCHER=ccache | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
| -DFORCE_COLORED_OUTPUT=true | |
| -Wno-dev" | |
| - name: Build | |
| working-directory: ${{ github.workspace }}/build | |
| run: cmake --build . -j4 | |
| - name: Store created artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: target-wasm-${{ runner.os }}-qt${{ matrix.config.qt_version }} | |
| path: ${{ github.workspace }}/build/target | |
| build-riscv-tests: | |
| name: Build official RISC-V tests | |
| # Avoid duplicate builds on PR from the same repository | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: git submodule update --recursive --init | |
| - name: Get cache key | |
| uses: mathiasvr/command-output@v2.0.0 | |
| id: subtree-hash | |
| with: | |
| run: git rev-parse HEAD:tests/riscv-official/ | |
| - name: Cache | |
| id: cache-tests | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/tests/riscv-official/isa | |
| key: riscv-tests-${{ steps.subtree-hash.outputs.stdout }} | |
| - name: Toolchain for official RISC-V tests | |
| if: ${{ steps.cache-tests.outputs.cache-hit != 'true' }} | |
| working-directory: ${{ github.workspace }}/tests/riscv-official | |
| # Version 14 is needed to correctly process newer parts of RV | |
| run: | | |
| ### Ubuntu 22 already provides those | |
| # echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" | sudo tee -a /etc/apt/sources.list && | |
| # wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - && | |
| sudo apt-get update && | |
| sudo apt-get install clang-14 lldb-14 lld-14 | |
| - name: Build official RISC-V tests | |
| if: ${{ steps.cache-tests.outputs.cache-hit != 'true' }} | |
| working-directory: ${{ github.workspace }}/tests/riscv-official/isa | |
| env: | |
| RISCV_COMPILER: clang-14 | |
| USE_CLANG_OPTS: true | |
| RISCV_OBJDUMP_CMD: llvm-objdump-14 | |
| run: make | |
| - name: Store created artifacts | |
| # Use of tar significantly improves performance as artifact upload has significant per file penalty | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: riscv-official-tests | |
| path: tests/riscv-official/isa | |
| build-stud-support-tests: | |
| name: Build stud-support (${{ matrix.toolchain }}-rv${{ matrix.xlen }}) | |
| # Avoid duplicate builds on PR from the same repository | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| toolchain: [gcc, clang] | |
| xlen: [32] | |
| env: | |
| STUD_SUPPORT_REV: 53c684c05dc990e6043fcc3c9a346b2173610731 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Cache stud-support tests | |
| id: cache-stud-support | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/tests/stud-support/elfs-${{ matrix.toolchain }}-rv${{ matrix.xlen }} | |
| key: stud-support-tests-${{ matrix.toolchain }}-rv${{ matrix.xlen }}-${{ env.STUD_SUPPORT_REV }} | |
| - name: Checkout stud-support | |
| if: ${{ steps.cache-stud-support.outputs.cache-hit != 'true' }} | |
| run: | | |
| git clone https://gitlab.fel.cvut.cz/b35apo/stud-support.git stud-support | |
| cd stud-support | |
| git checkout ${{ env.STUD_SUPPORT_REV }} | |
| - name: Install GCC RISC-V toolchain | |
| if: ${{ steps.cache-stud-support.outputs.cache-hit != 'true' && matrix.toolchain == 'gcc' }} | |
| run: | | |
| sudo apt-get update && | |
| sudo apt-get install -y gcc-riscv64-unknown-elf | |
| - name: Install Clang/LLVM toolchain | |
| if: ${{ steps.cache-stud-support.outputs.cache-hit != 'true' && matrix.toolchain == 'clang' }} | |
| run: | | |
| sudo apt-get update && | |
| sudo apt-get install -y clang lld llvm | |
| - name: Build stud-support (${{ matrix.toolchain }}-rv${{ matrix.xlen }}) | |
| if: ${{ steps.cache-stud-support.outputs.cache-hit != 'true' }} | |
| working-directory: ${{ github.workspace }}/tests/stud-support | |
| run: | | |
| python build_tests.py \ | |
| --stud-support-path ../../stud-support \ | |
| --output-dir elfs-${{ matrix.toolchain }}-rv${{ matrix.xlen }} \ | |
| --xlen ${{ matrix.xlen }} \ | |
| ${{ matrix.toolchain == 'clang' && '--use-clang' || '--use-gcc' }} | |
| - name: Store stud-support artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: stud-support-tests-${{ matrix.toolchain }}-rv${{ matrix.xlen }} | |
| path: tests/stud-support/elfs-${{ matrix.toolchain }}-rv${{ matrix.xlen }} |