Skip to content

Commit

Permalink
Add back windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Jul 18, 2024
1 parent 5f95e31 commit bb9dc82
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand Down
41 changes: 29 additions & 12 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
tags: "*"
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build-test-cmake:
name: CMake
Expand All @@ -20,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'

Expand Down Expand Up @@ -59,7 +63,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-13', 'macos-latest']
os: ['ubuntu-latest', 'macos-13', 'macos-latest', 'windows-2019']
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
- os: macos-latest
Expand All @@ -70,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
Expand Down Expand Up @@ -135,7 +152,7 @@ jobs:

steps:
- name: Get wheels
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: artifacts

Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Windows Compile

on:
push:
branches:
- main
- 'version-**'
tags: "*"
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build-cmake:
name: CMake

strategy:
fail-fast: false
matrix:
os: ['windows-2019']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
# required for `git describe --tags` to work
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python.exe -m pip install --upgrade pip
python.exe -m pip install "conan<2"
- name: Build ResData
run: |
python.exe -m pip install -r requirements.txt
mkdir cmake-build
cmake -S . -B cmake-build -G "Visual Studio 16 2019"
cmake --build cmake-build
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ scratch.sparsebundle
/venv/
/_skbuild/
/python/resdata/version.py
.*
*.egg-info/

/dist
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 0 additions & 26 deletions VisualStudio/stdbool.h

This file was deleted.

0 comments on commit bb9dc82

Please sign in to comment.