Skip to content

Commit

Permalink
Use a CMake workflow to validate results file in CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
LegalizeAdulthood committed Jan 10, 2024
1 parent dfcceb6 commit 3fb2ff3
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 13 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,21 @@ on:
pull_request:
branches: [ "master" ]

env:
BUILD_TYPE: Release

jobs:
linux-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: CMake workflow
run: cmake --workflow --preset default

windows-build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: CMake workflow
run: cmake --workflow --preset default
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.13)
cmake_policy(VERSION 3.13)
project(refactor-test-suite)
include(CTest)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT refactor-test-suite)
Expand All @@ -11,3 +12,4 @@ add_subdirectory(TestDiffs)
add_subdirectory(TestNames)
add_subdirectory(TestResults)
add_subdirectory(ToolSummary)
add_subdirectory(results)
20 changes: 20 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,29 @@
"name": "default",
"displayName": "default",
"configurePreset": "default",
"configuration": "Debug",
"output": {
"outputOnFailure": true
}
}
],
"workflowPresets": [
{
"name": "default",
"steps": [
{
"type": "configure",
"name": "default"
},
{
"type": "build",
"name": "default"
},
{
"type": "test",
"name": "default"
}
]
}
]
}
18 changes: 18 additions & 0 deletions results/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
if(NOT BUILD_TESTING)
return()
endif()

foreach(result
#AppleXcode
ClangTidy
#CLion
#EclipseCDT
#QtCreator
ReSharperCpp
VisualAssistX
VisualStudio
)
add_test(NAME check-${result}-results
COMMAND test-results ${CMAKE_SOURCE_DIR}/RefactorTest ${CMAKE_CURRENT_SOURCE_DIR}/${result}Results.md
)
endforeach()

0 comments on commit 3fb2ff3

Please sign in to comment.