From f73f901b8f09bcd5f84d9eae08f01a4d4c3a20cd Mon Sep 17 00:00:00 2001 From: Sam Morley <41870650+inakleinbottle@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:02:26 +0000 Subject: [PATCH] Fix various things with the GitHub actions (#183) * Enable push trigger in test workflow and update ignored paths Reinstated the push trigger for workflow runs on the "main" branch and significantly expanded the list of ignored paths. These updates optimize workflow execution by excluding files and directories unrelated to tests. * Add MSYS2 setup and clean up redundant env variables This commit adds MSYS2 to the path and sets a required environment variable for Windows builds. Additionally, it removes the redundant `VERBOSE` environment variable from the cmake configuration and build steps. These changes streamline and improve the build workflow for Windows runners. * Set VCPKG_FORCE_SYSTEM_BINARIES in build env instead of CI env Moved the `VCPKG_FORCE_SYSTEM_BINARIES` assignment from the CI environment setup to the build environment. This ensures the variable is only set where it's specifically needed, reducing scope and potential side effects. * Remove commented-out MSBuild setup from GitHub workflow The unused MSBuild setup lines were removed to clean up the workflow file. This improves readability and ensures only relevant configuration is retained. No functional changes were made. * Remove redundant msys2 path setup in Windows CI workflow The step to add msys2 to the PATH has been removed as it is no longer necessary. This simplifies the workflow and avoids unnecessary operations during the CI run. --- .github/workflows/tests.yml | 40 +++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4fa757442..9926140b0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,15 +2,26 @@ name: tests on: workflow_dispatch: -# push: -# branches: [ "main" ] -# paths-ignore: -# - "examples/**" -# - "doc/**" -# - "README.md" -# - "*.txt" -# - "CHANGELOG" -# - "tools/*.py" + push: + branches: [ "main" ] + paths-ignore: + - "examples/**" + - "doc/**" + - "README.md" + - "CHANGELOG" + - "tools/*.py" + - ".github/workflows/build_wheels.yml" + - ".github/dependabot.yml" + - ".github/ISSUE_TEMPLATE/**" + - "branding/**" + - ".gitignore" + - "CMakePresets.json" + - "THANKS.txt" + - "LICENSE.txt" + - "VERSION.txt" + - "CITATION.cff" + - ".gitignore" + pull_request: branches: [ "main" ] paths-ignore: @@ -30,6 +41,8 @@ on: - "VERSION.txt" - "CITATION.cff" - ".gitignore" + + env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release @@ -66,11 +79,6 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - # - uses: microsoft/setup-msbuild@v1.1 - # if: runner.os == 'Windows' - # with: - # msbuild-architecture: x64 - - name: use ninja shell: bash run: | @@ -116,15 +124,13 @@ jobs: run: | cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DROUGHPY_BUILD_TESTS=ON -DROUGHPY_BUILD_PYMODULE_INPLACE=ON env: - VERBOSE: 1 CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/tools/vcpkg/scripts/buildsystems/vcpkg.cmake MACOSX_DEPLOYMENT_TARGET: 11.0.0 + VCPKG_FORCE_SYSTEM_BINARIES: 1 - name: Build # Build your program with the given configuration run: cmake --build ${{ github.workspace }}/build --config ${{env.BUILD_TYPE}} - env: - VERBOSE: 1 - name: Test shell: bash