Skip to content

Run fast builds when Spellcheck and CodeStyle succeed #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions .github/workflows/fast.yml
Original file line number Diff line number Diff line change
@@ -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
137 changes: 7 additions & 130 deletions .github/workflows/pr_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down