From c7a574d36a143673467d1e3fe68a3a1eaf2e493e Mon Sep 17 00:00:00 2001 From: Seth R Johnson Date: Mon, 27 May 2024 08:43:23 -0400 Subject: [PATCH] Add windows CI build with fetching of googletest+json --- .github/workflows/build-fast.yml | 51 ++++++++++++++++++++ scripts/cmake-presets/ci-windows-github.json | 11 ++++- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-fast.yml b/.github/workflows/build-fast.yml index 203b60e66e..ecad8c7814 100644 --- a/.github/workflows/build-fast.yml +++ b/.github/workflows/build-fast.yml @@ -90,5 +90,56 @@ jobs: if: ${{!cancelled()}} run: | ccache -s + windows: + env: + CCACHE_DIR: "${{github.workspace}}\\.ccache" + CCACHE_MAXSIZE: "100Mi" + CMAKE_PRESET: fast + runs-on: windows-latest + steps: + - name: Install dependencies + run: | + choco install ninja ccache + - name: Check out Celeritas + uses: actions/checkout@v4 + - name: Set up MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Cache ccache + uses: actions/cache@v4 + with: + path: ${{env.CCACHE_DIR}} + key: ccache-fast-windows-${{github.run_id}} + restore-keys: | + ccache-fast + - name: Zero ccache stats + run: | + ccache -z + - name: Configure Celeritas + shell: pwsh + run: | + Copy-Item scripts/cmake-presets/ci-windows-github.json -Destination CMakeUserPresets.json + cmake --preset=$Env:CMAKE_PRESET ` + -DCeleritas_GIT_DESCRIBE="${{github.event.pull_request + && format(';-pr.{0};', github.event.pull_request.number) + || format(';-{0};', github.ref_name)}}" + - name: Build all + run: | + cmake --build --preset=$Env:CMAKE_PRESET + - name: Test all + continue-on-error: true + run: | + ctest --preset=$Env:CMAKE_PRESET + - name: Install + working-directory: build + run: | + cmake --install --preset=$Env:CMAKE_PRESET + - name: Check installation + working-directory: install + run: | + ./bin/celer-sim --version + - name: Show ccache stats + if: ${{!cancelled()}} + run: | + ccache -s # vim: set nowrap tw=100: diff --git a/scripts/cmake-presets/ci-windows-github.json b/scripts/cmake-presets/ci-windows-github.json index 4c5a504e3a..5ba7bcb1f4 100644 --- a/scripts/cmake-presets/ci-windows-github.json +++ b/scripts/cmake-presets/ci-windows-github.json @@ -11,7 +11,7 @@ "cacheVariables": { "BUILD_SHARED_LIBS": {"type": "BOOL", "value": "OFF"}, "CELERITAS_BUILD_DEMOS": {"type": "BOOL", "value": "OFF"}, - "CELERITAS_BUILD_TESTS": {"type": "BOOL", "value": "ON"}, + "CELERITAS_BUILD_TESTS": {"type": "BOOL", "value": "OFF"}, "CELERITAS_BUILD_DOCS": {"type": "BOOL", "value": "OFF"}, "CELERITAS_DEBUG": {"type": "BOOL", "value": "ON"}, "CELERITAS_TEST_VERBOSE":{"type": "BOOL", "value": "OFF"}, @@ -34,6 +34,15 @@ "CMAKE_INSTALL_PREFIX": "${sourceDir}/install" } }, + { + "name": "fast", + "inherits": ["base"], + "displayName": "fast build with testing and JSON", + "cacheVariables": { + "CELERITAS_BUILD_TESTS": {"type": "BOOL", "value": "ON"}, + "CELERITAS_USE_JSON": {"type": "BOOL", "value": "ON"} + } + }, { "name": "ultralite", "inherits": ["base"],