From aece8b49a95c1cb8bbb603387a3bace290ab99cd Mon Sep 17 00:00:00 2001 From: larsevj Date: Fri, 28 Jun 2024 13:56:58 +0200 Subject: [PATCH] Try more --- .github/workflows/style.yml | 2 +- .github/workflows/testing.yml | 39 +++++++++++++++++++++++------------ .github/workflows/windows.yml | 8 +++---- CMakeLists.txt | 6 +++++- VisualStudio/stdbool.h | 26 ----------------------- lib/include/ert/stdbool.h | 26 ----------------------- 6 files changed, 36 insertions(+), 71 deletions(-) delete mode 100644 VisualStudio/stdbool.h delete mode 100644 lib/include/ert/stdbool.h diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index cd43adbbe8..0dbb6e2699 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -9,7 +9,7 @@ jobs: runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index a922211e2e..452d1066d1 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -24,14 +24,14 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: # required for `git describe --tags` to work fetch-depth: 0 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.11' @@ -63,8 +63,8 @@ jobs: strategy: fail-fast: false matrix: - os: ['ubuntu-latest', 'macos-13', 'macos-latest'] - python: ['3.8', '3.9', '3.10', '3.11', '3.12'] + os: ['ubuntu-latest', 'macos-13', 'macos-latest', 'windows-2019'] + python: ['3.11'] #['3.8', '3.9', '3.10', '3.11', '3.12'] exclude: - os: macos-latest python: '3.8' @@ -74,37 +74,50 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: # required for `git describe --tags` to work fetch-depth: 0 - name: Build Linux Wheel + if: matrix.os == 'ubuntu-latest' uses: docker://quay.io/pypa/manylinux2014_x86_64 with: entrypoint: /github/workspace/ci/github/build_linux_wheel.sh args: ${{ matrix.python }} - if: matrix.os == 'ubuntu-latest' - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - name: Build macOS/Windows Wheel + - name: Build macOS Wheel + if: runner.os == 'macOS' run: pip wheel . --no-deps -w dist - if: matrix.os != 'ubuntu-latest' + + - name: Build Windows Wheel + if: runner.os == 'windows' + run: | + python.exe -m pip wheel . --no-deps -w dist - name: Upload wheel as artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.os }} Python ${{ matrix.python }} wheel path: dist/* - - name: Install + - name: Install for non Windows + if: runner.os != 'windows' run: pip install dist/* - - name: Run Python tests + - name: Install for Windows + if: runner.os == 'windows' + run: | + pip install (get-item .\dist\*) + python -c "import resdata" + + - name: Run Python tests non Windows + if: runner.os != 'windows' run: | # Runs tests on installed distribution from an empty directory python -m pip install pytest @@ -139,7 +152,7 @@ jobs: steps: - name: Get wheels - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: path: artifacts diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 613581b8d9..8aed2b66c0 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -36,12 +36,12 @@ jobs: - name: Install dependencies run: | - pip install -U pip - pip install "conan<2" + python.exe -m pip install --upgrade pip + python.exe -m pip install "conan<2" - name: Build ResData run: | - python3 -m pip install -r requirements.txt + python.exe -m pip install -r requirements.txt mkdir cmake-build - cmake -S . -B cmake-build -G "Visual Studio 16 2019" -DBUILD_SHARED_LIBS="ON" -DBUILD_TESTING=OFF + cmake -S . -B cmake-build -G "Visual Studio 16 2019" cmake --build cmake-build diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b2852ef64..773bd6328f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) include(GNUInstallDirs) include(TestBigEndian) -option(BUILD_TESTS "Should the tests be built" ON) +if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + option(BUILD_TESTS "Should the tests be built" OFF) +else() + option(BUILD_TESTS "Should the tests be built" ON) +endif() option(BUILD_APPLICATIONS "Should we build small utility applications" OFF) option(BUILD_RD_SUMMARY "Build the commandline application rd_summary" OFF) option(BUILD_SHARED_LIBS "Build shared libraries" ON) diff --git a/VisualStudio/stdbool.h b/VisualStudio/stdbool.h deleted file mode 100644 index c599cf5cbd..0000000000 --- a/VisualStudio/stdbool.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - The ert code is based on C99, and in particular makes extensive use - of the C99 feature stdbool.h. When including the ert headers in a - VisualStudio C++ project this creates problems because the - VisualStudio C compiler is not C99 conforming, and the compiler will - complain it can not find the stdbool.h header. - - The symbols defined in the stdbool header are actually correctly(?) - defined by the VisualStudio compiler already, so this header file - does not define any bool related symbols! - - To actually use this file you should copy it manually into the ert - include directory as used by VisualStudio. -*/ - -#ifndef ERT_STDBOOL_H -#define ERT_STDBOOL_H - -#ifndef __cplusplus -typedef int bool; -#define true 1 -#define false 0 -#endif - - -#endif diff --git a/lib/include/ert/stdbool.h b/lib/include/ert/stdbool.h deleted file mode 100644 index c599cf5cbd..0000000000 --- a/lib/include/ert/stdbool.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - The ert code is based on C99, and in particular makes extensive use - of the C99 feature stdbool.h. When including the ert headers in a - VisualStudio C++ project this creates problems because the - VisualStudio C compiler is not C99 conforming, and the compiler will - complain it can not find the stdbool.h header. - - The symbols defined in the stdbool header are actually correctly(?) - defined by the VisualStudio compiler already, so this header file - does not define any bool related symbols! - - To actually use this file you should copy it manually into the ert - include directory as used by VisualStudio. -*/ - -#ifndef ERT_STDBOOL_H -#define ERT_STDBOOL_H - -#ifndef __cplusplus -typedef int bool; -#define true 1 -#define false 0 -#endif - - -#endif