diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3897a2c0..918dc289 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2025 Lukasz Stalmirski +# Copyright (c) 2019-2026 Lukasz Stalmirski # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -44,8 +44,8 @@ jobs: # Build configs. strategy: matrix: - build_type: ${{fromJson(format('[{0}]', inputs.build_types || '"Release","Debug"'))}} - os: ${{fromJson(format('[{0}]', inputs.operating_systems || '"windows-latest","ubuntu-24.04","ubuntu-22.04"'))}} + build_type: ${{fromJson(format('[{0}]', inputs.build_types || '"Release"'))}} + os: ${{fromJson(format('[{0}]', inputs.operating_systems || '"ubuntu-24.04"'))}} name: Build ${{matrix.os}} ${{matrix.build_type}} runs-on: ${{matrix.os}} @@ -60,7 +60,7 @@ jobs: uses: awalsh128/cache-apt-pkgs-action@latest if: runner.os == 'Linux' with: - packages: extra-cmake-modules libvulkan-dev libxkbcommon-dev libx11-dev libxext-dev libxcb1-dev libxcb-shape0-dev libdrm-dev + packages: extra-cmake-modules libvulkan-dev libxkbcommon-dev libx11-dev libxext-dev libxcb1-dev libxcb-shape0-dev libdrm-dev glslang-tools version: 1.0 - uses: actions/setup-python@v5 @@ -77,16 +77,59 @@ jobs: - name: Build # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j 4 - + - name: Install if: matrix.build_type == 'Release' # Install build artifacts to a common directory run: cmake --install ${{github.workspace}}/build --prefix ${{github.workspace}}/install + - name: Install tests + if: ${{ matrix.build_type == 'Release' && matrix.os == 'ubuntu-24.04' }} + run: cmake --install ${{github.workspace}}/build --prefix ${{github.workspace}}/install_test --component Test + - name: Publish artifacts if: matrix.build_type == 'Release' uses: actions/upload-artifact@v4 with: name: ${{matrix.os}}-${{matrix.build_type}}-${{runner.arch}} path: ${{github.workspace}}/install + retention-days: 7 + + - name: Publish tests artifacts + if: ${{ matrix.build_type == 'Release' && matrix.os == 'ubuntu-24.04' }} + uses: actions/upload-artifact@v4 + with: + name: ${{matrix.os}}-Tests-${{runner.arch}} + path: ${{github.workspace}}/install_test retention-days: 1 + + test: + if: github.event.pull_request.draft == false + + name: Test + needs: build + runs-on: ubuntu-24.04 + + steps: + - name: Download Test package + uses: actions/download-artifact@v8 + with: + name: ubuntu-24.04-Tests-${{runner.arch}} + path: ${{github.workspace}} + + - run: ls ${{github.workspace}} + + - name: Download layer package + uses: actions/download-artifact@v8 + with: + name: ubuntu-24.04-Release-${{runner.arch}} + path: ${{github.workspace}}/install + + - run: ls ${{github.workspace}}/install + + - name: Test + env: + VK_LAYER_PATH: ${{github.workspace}}/install/lib/x86_64-linux-gnu/ + run: | + chmod +x ${{github.workspace}}/bin/profiler_tests + ${{github.workspace}}/bin/profiler_tests diff --git a/VkLayer_profiler_layer/profiler_tests/CMakeLists.txt b/VkLayer_profiler_layer/profiler_tests/CMakeLists.txt index 3903da07..2c4e1c6a 100644 --- a/VkLayer_profiler_layer/profiler_tests/CMakeLists.txt +++ b/VkLayer_profiler_layer/profiler_tests/CMakeLists.txt @@ -64,5 +64,6 @@ if (BUILD_TESTS) PRIVATE "${CMAKE_CURRENT_BINARY_DIR}" ) - install (TARGETS profiler_tests) + install (TARGETS profiler_tests EXCLUDE_FROM_ALL + COMPONENT Test) endif (BUILD_TESTS)