Skip to content

Testing for UnixMake files on Windows #1313

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

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Changes from 7 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
218 changes: 117 additions & 101 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Various non-standard tests, requiring e.g. longer run
name: Nightly
name: Nightly.

# This job is run at 04:00 UTC every day or on demand.
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'
push:
branches-ignore:
- 'dependabot/**'
pull_request:

permissions:
contents: read
Expand All @@ -15,97 +15,97 @@ env:
INSTALL_DIR: "${{github.workspace}}/build/install"

jobs:
fuzz-test:
name: Fuzz test
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
compiler: [{c: clang, cxx: clang++}]
# fuzz-test:
# name: Fuzz test
# strategy:
# fail-fast: false
# matrix:
# build_type: [Debug, Release]
# compiler: [{c: clang, cxx: clang++}]

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y cmake hwloc libhwloc-dev libnuma-dev libtbb-dev

- name: Find Clang fuzzer lib
run: |
CLANG_LIBS_DIR=$(find /usr/lib -name "libclang_rt.fuzzer_no_main-x86_64.a" -exec dirname {} \; | head -n 1)
echo "CLANG_LIBS_DIR=${CLANG_LIBS_DIR}" >> $GITHUB_ENV

- name: Configure CMake
run: >
cmake
-B ${{github.workspace}}/build
-DCMAKE_PREFIX_PATH=${{env.CLANG_LIBS_DIR}}
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUMF_BUILD_SHARED_LIBRARY=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_FUZZTESTS=ON

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} --verbose -j$(nproc)

- name: Run regular tests
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -E "fuzz|test_init_teardown"

- name: Run regular tests with proxy library
working-directory: ${{env.BUILD_DIR}}
run: LD_PRELOAD=./lib/libumf_proxy.so ctest -C ${{matrix.build_type}} --output-on-failure -E "fuzz|test_init_teardown"

- name: Fuzz long test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure --verbose -L "fuzz-long"

valgrind:
name: Valgrind
strategy:
fail-fast: false
matrix:
tool: ['memcheck', 'drd', 'helgrind']
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y cmake hwloc libhwloc-dev libnuma-dev libtbb-dev valgrind

- name: Configure CMake
run: >
cmake
-B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=Debug
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
-DUMF_BUILD_CUDA_PROVIDER=OFF
-DUMF_USE_VALGRIND=1
-DUMF_TESTS_FAIL_ON_SKIP=ON

- name: Build
run: cmake --build ${{github.workspace}}/build --config Debug -j$(nproc)

- name: Run tests under valgrind
run: ${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{github.workspace}}/build ${{matrix.tool}}
# runs-on: ubuntu-latest

# steps:
# - name: Checkout repository
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# with:
# fetch-depth: 0

# - name: Install apt packages
# run: |
# sudo apt-get update
# sudo apt-get install -y cmake hwloc libhwloc-dev libnuma-dev libtbb-dev

# - name: Find Clang fuzzer lib
# run: |
# CLANG_LIBS_DIR=$(find /usr/lib -name "libclang_rt.fuzzer_no_main-x86_64.a" -exec dirname {} \; | head -n 1)
# echo "CLANG_LIBS_DIR=${CLANG_LIBS_DIR}" >> $GITHUB_ENV

# - name: Configure CMake
# run: >
# cmake
# -B ${{github.workspace}}/build
# -DCMAKE_PREFIX_PATH=${{env.CLANG_LIBS_DIR}}
# -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
# -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
# -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
# -DUMF_BUILD_SHARED_LIBRARY=ON
# -DUMF_TESTS_FAIL_ON_SKIP=ON
# -DUMF_DEVELOPER_MODE=ON
# -DUMF_BUILD_FUZZTESTS=ON

# - name: Build
# run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} --verbose -j$(nproc)

# - name: Run regular tests
# working-directory: ${{github.workspace}}/build
# run: ctest -C ${{matrix.build_type}} --output-on-failure -E "fuzz|test_init_teardown"

# - name: Run regular tests with proxy library
# working-directory: ${{env.BUILD_DIR}}
# run: LD_PRELOAD=./lib/libumf_proxy.so ctest -C ${{matrix.build_type}} --output-on-failure -E "fuzz|test_init_teardown"

# - name: Fuzz long test
# working-directory: ${{github.workspace}}/build
# run: ctest -C ${{matrix.build_type}} --output-on-failure --verbose -L "fuzz-long"

# valgrind:
# name: Valgrind
# strategy:
# fail-fast: false
# matrix:
# tool: ['memcheck', 'drd', 'helgrind']
# runs-on: ubuntu-latest

# steps:
# - name: Checkout repository
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# with:
# fetch-depth: 0

# - name: Install apt packages
# run: |
# sudo apt-get update
# sudo apt-get install -y cmake hwloc libhwloc-dev libnuma-dev libtbb-dev valgrind

# - name: Configure CMake
# run: >
# cmake
# -B ${{github.workspace}}/build
# -DCMAKE_BUILD_TYPE=Debug
# -DUMF_FORMAT_CODE_STYLE=OFF
# -DUMF_DEVELOPER_MODE=ON
# -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
# -DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
# -DUMF_BUILD_CUDA_PROVIDER=OFF
# -DUMF_USE_VALGRIND=1
# -DUMF_TESTS_FAIL_ON_SKIP=ON

# - name: Build
# run: cmake --build ${{github.workspace}}/build --config Debug -j$(nproc)

# - name: Run tests under valgrind
# run: ${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{github.workspace}}/build ${{matrix.tool}}

Windows-generators:
name: Windows ${{matrix.generator}} generator
Expand All @@ -115,7 +115,7 @@ jobs:
compiler: [{c: cl, cxx: cl}]
shared_library: ['ON', 'OFF']
static_hwloc: ['ON', 'OFF']
generator: ['Ninja', 'NMake Makefiles']
generator: ['Unix Makefiles']
umfd_lib: ['ON', 'OFF']

runs-on: windows-latest
Expand Down Expand Up @@ -150,17 +150,33 @@ jobs:
if: matrix.generator == 'Ninja'
uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6

- name: Configure MSVC environment
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
# - name: Configure MSVC environment
# uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0

- name: Install llvm-mingw
run: |
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20250430/llvm-mingw-20250430-ucrt-x86_64.zip
- name: Install llvm-mingw (extract)
run: |
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
del llvm-mingw*.zip
mv llvm-mingw* c:\llvm-mingw
echo "c:\llvm-mingw\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
dir "c:\llvm-mingw\bin"
- name: cmake version
run: |
cmake --version
make --version
gcc --version

- name: Configure build
run: >
cmake
-B ${{env.BUILD_DIR}}
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DCMAKE_PREFIX_PATH="c:\llvm-mingw\bin"
-DCMAKE_C_COMPILER="x86_64-w64-mingw32-${{matrix.compiler.c}}.exe"
-DCMAKE_CXX_COMPILER="x86_64-w64-mingw32-${{matrix.compiler.c}}.exe"
-G "${{matrix.generator}}"
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DUMF_LINK_HWLOC_STATICALLY=${{matrix.static_hwloc}}
Expand Down
Loading