From 47d6ea1dc7036eb754e871b47115f20535420cce Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Fri, 5 Jul 2024 09:43:35 +0200 Subject: [PATCH] Run fast builds when Spellcheck and CodeStyle succeed Signed-off-by: Lukasz Dorau --- .github/workflows/fast.yml | 135 +++++++++++++++++++++++++++++++++ .github/workflows/pr_push.yml | 137 ++-------------------------------- 2 files changed, 142 insertions(+), 130 deletions(-) create mode 100644 .github/workflows/fast.yml diff --git a/.github/workflows/fast.yml b/.github/workflows/fast.yml new file mode 100644 index 0000000000..9674c5820c --- /dev/null +++ b/.github/workflows/fast.yml @@ -0,0 +1,135 @@ +# Fast builds +name: FastBuild + +on: workflow_call + +permissions: + contents: read + +jobs: + FastBuild: + name: Fast builds + env: + VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows" + strategy: + matrix: + include: + - os: windows-latest + disjoint: 'OFF' + build_tests: 'ON' + simple_cmake: 'OFF' + # pure C build (Windows) + - os: windows-latest + disjoint: 'OFF' + # Tests' building is off for a pure C build + build_tests: 'OFF' + simple_cmake: 'OFF' + - os: ubuntu-latest + disjoint: 'ON' + build_tests: 'ON' + # Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command + extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON -DUMF_BUILD_BENCHMARKS_MT=ON' + simple_cmake: 'OFF' + # pure C build (Linux) + - os: ubuntu-latest + disjoint: 'OFF' + # Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command + # Tests' building is off for a pure C build + build_tests: 'OFF' + extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON' + simple_cmake: 'OFF' + # simplest CMake on ubuntu-latest + - os: ubuntu-latest + disjoint: 'OFF' + build_tests: 'ON' + extra_build_options: '-DCMAKE_BUILD_TYPE=Release' + simple_cmake: 'ON' + # simplest CMake ubuntu-20.04 + - os: ubuntu-20.04 + disjoint: 'OFF' + build_tests: 'ON' + extra_build_options: '-DCMAKE_BUILD_TYPE=Release' + simple_cmake: 'ON' + runs-on: ${{matrix.os}} + + steps: + - name: Checkout repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Initialize vcpkg + if: matrix.os == 'windows-latest' + uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5 + with: + vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289 + vcpkgDirectory: ${{github.workspace}}/build/vcpkg + vcpkgJsonGlob: '**/vcpkg.json' + + - name: Install dependencies + if: matrix.os == 'windows-latest' + run: vcpkg install + shell: pwsh # Specifies PowerShell as the shell for running the script. + + - name: Install apt packages (ubuntu-latest) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y cmake libjemalloc-dev libhwloc-dev libnuma-dev libtbb-dev + + - name: Install apt packages (ubuntu-20.04) + if: matrix.os == 'ubuntu-20.04' + run: | + sudo apt-get update + sudo apt-get install -y cmake libjemalloc-dev libnuma-dev libtbb-dev + .github/scripts/install_hwloc.sh # install hwloc-2.3.0 instead of hwloc-2.1.0 present in the OS package + + - name: Set ptrace value for IPC test (on Linux only) + if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-20.04' }} + run: sudo bash -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope" + + - name: Configure CMake + if: matrix.simple_cmake == 'OFF' + run: > + cmake + -B ${{github.workspace}}/build + -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}" + -DUMF_FORMAT_CODE_STYLE=OFF + -DUMF_DEVELOPER_MODE=ON + -DUMF_BUILD_LIBUMF_POOL_DISJOINT=${{matrix.disjoint}} + -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON + -DUMF_BUILD_TESTS=${{matrix.build_tests}} + -DUMF_BUILD_EXAMPLES=ON + -DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON + -DUMF_TESTS_FAIL_ON_SKIP=ON + -DUMF_BUILD_SHARED_LIBRARY=ON + ${{matrix.extra_build_options}} + + - name: Configure CMake (simple) + if: matrix.simple_cmake == 'ON' + run: > + cmake + -B ${{github.workspace}}/build + -DUMF_BUILD_SHARED_LIBRARY=ON + -DUMF_TESTS_FAIL_ON_SKIP=ON + ${{matrix.extra_build_options}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config Release -j + + - name: Run examples + working-directory: ${{github.workspace}}/build + run: ctest --output-on-failure --test-dir examples -C Release + + - name: Run tests + if: matrix.build_tests == 'ON' + working-directory: ${{github.workspace}}/build + run: ctest --output-on-failure --test-dir test -C Release + + - name: check /DEPENDENTLOADFLAG (Windows only) + if: matrix.os == 'windows-latest' + run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{github.workspace}}/build/bin/Release/umf.dll + shell: pwsh + + - name: check /DEPENDENTLOADFLAG in umf_proxy.dll + if: matrix.os == 'windows-latest' + run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{github.workspace}}/build/src/proxy_lib/Release/umf_proxy.dll + shell: pwsh diff --git a/.github/workflows/pr_push.yml b/.github/workflows/pr_push.yml index cec3456620..525e4ac9e6 100644 --- a/.github/workflows/pr_push.yml +++ b/.github/workflows/pr_push.yml @@ -15,133 +15,6 @@ permissions: contents: read jobs: - FastBuild: - name: Fast build - env: - VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows" - strategy: - matrix: - include: - - os: windows-latest - disjoint: 'OFF' - build_tests: 'ON' - simple_cmake: 'OFF' - # pure C build (Windows) - - os: windows-latest - disjoint: 'OFF' - # Tests' building is off for a pure C build - build_tests: 'OFF' - simple_cmake: 'OFF' - - os: ubuntu-latest - disjoint: 'ON' - build_tests: 'ON' - # Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command - extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON -DUMF_BUILD_BENCHMARKS_MT=ON' - simple_cmake: 'OFF' - # pure C build (Linux) - - os: ubuntu-latest - disjoint: 'OFF' - # Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command - # Tests' building is off for a pure C build - build_tests: 'OFF' - extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON' - simple_cmake: 'OFF' - # simplest CMake on ubuntu-latest - - os: ubuntu-latest - disjoint: 'OFF' - build_tests: 'ON' - extra_build_options: '-DCMAKE_BUILD_TYPE=Release' - simple_cmake: 'ON' - # simplest CMake ubuntu-20.04 - - os: ubuntu-20.04 - disjoint: 'OFF' - build_tests: 'ON' - extra_build_options: '-DCMAKE_BUILD_TYPE=Release' - simple_cmake: 'ON' - runs-on: ${{matrix.os}} - - steps: - - name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Initialize vcpkg - if: matrix.os == 'windows-latest' - uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5 - with: - vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289 - vcpkgDirectory: ${{github.workspace}}/build/vcpkg - vcpkgJsonGlob: '**/vcpkg.json' - - - name: Install dependencies - if: matrix.os == 'windows-latest' - run: vcpkg install - shell: pwsh # Specifies PowerShell as the shell for running the script. - - - name: Install apt packages (ubuntu-latest) - if: matrix.os == 'ubuntu-latest' - run: | - sudo apt-get update - sudo apt-get install -y cmake libjemalloc-dev libhwloc-dev libnuma-dev libtbb-dev - - - name: Install apt packages (ubuntu-20.04) - if: matrix.os == 'ubuntu-20.04' - run: | - sudo apt-get update - sudo apt-get install -y cmake libjemalloc-dev libnuma-dev libtbb-dev - .github/scripts/install_hwloc.sh # install hwloc-2.3.0 instead of hwloc-2.1.0 present in the OS package - - - name: Set ptrace value for IPC test (on Linux only) - if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-20.04' }} - run: sudo bash -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope" - - - name: Configure CMake - if: matrix.simple_cmake == 'OFF' - run: > - cmake - -B ${{github.workspace}}/build - -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}" - -DUMF_FORMAT_CODE_STYLE=OFF - -DUMF_DEVELOPER_MODE=ON - -DUMF_BUILD_LIBUMF_POOL_DISJOINT=${{matrix.disjoint}} - -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON - -DUMF_BUILD_TESTS=${{matrix.build_tests}} - -DUMF_BUILD_EXAMPLES=ON - -DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON - -DUMF_TESTS_FAIL_ON_SKIP=ON - -DUMF_BUILD_SHARED_LIBRARY=ON - ${{matrix.extra_build_options}} - - - name: Configure CMake (simple) - if: matrix.simple_cmake == 'ON' - run: > - cmake - -B ${{github.workspace}}/build - -DUMF_BUILD_SHARED_LIBRARY=ON - -DUMF_TESTS_FAIL_ON_SKIP=ON - ${{matrix.extra_build_options}} - - - name: Build - run: cmake --build ${{github.workspace}}/build --config Release -j - - - name: Run examples - working-directory: ${{github.workspace}}/build - run: ctest --output-on-failure --test-dir examples -C Release - - - name: Run tests - if: matrix.build_tests == 'ON' - working-directory: ${{github.workspace}}/build - run: ctest --output-on-failure --test-dir test -C Release - - - name: check /DEPENDENTLOADFLAG (Windows only) - if: matrix.os == 'windows-latest' - run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{github.workspace}}/build/bin/Release/umf.dll - shell: pwsh - - - name: check /DEPENDENTLOADFLAG in umf_proxy.dll - if: matrix.os == 'windows-latest' - run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{github.workspace}}/build/src/proxy_lib/Release/umf_proxy.dll - shell: pwsh - CodeStyle: name: Coding style runs-on: ubuntu-latest @@ -197,15 +70,19 @@ jobs: Spellcheck: uses: ./.github/workflows/spellcheck.yml + FastBuild: + name: Fast builds + needs: [Spellcheck, CodeStyle] + uses: ./.github/workflows/fast.yml Build: name: Basic builds - needs: [Spellcheck, FastBuild, CodeStyle] + needs: [FastBuild] uses: ./.github/workflows/basic.yml Sanitizers: - needs: [Spellcheck, FastBuild, CodeStyle] + needs: [FastBuild] uses: ./.github/workflows/sanitizers.yml Qemu: - needs: [Spellcheck, FastBuild, CodeStyle] + needs: [FastBuild] uses: ./.github/workflows/qemu.yml Benchmarks: needs: [Build]