-
Notifications
You must be signed in to change notification settings - Fork 94
108 lines (87 loc) · 2.98 KB
/
windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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
build-test-wheel:
name: Python
strategy:
fail-fast: false
matrix:
os: ['windows-2019']
python: ['3.11']
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: ${{ matrix.python }}
- name: Build Windows Wheel
run: |
python.exe -m pip install -U build delvewheel
python.exe -m build --wheel
- name: Upload wheel as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }} Python ${{ matrix.python }} wheel
path: dist/*
- name: Install
run: Get-ChildItem dist\* | ForEach-Object { python.exe -m pip install $_.FullName }
- name: Run Python tests
run: |
# Runs tests on installed distribution from an empty directory
python.exe -m pip install -r test_requirements.txt
# pytest adds every directory up-to and including python/ into sys.path,
# meaning that "import resdata" will import python/resdata and not the installed
# one. This doesn't work because the resdata.so library only exists in
# site-packages, so we copy directories required by the tests out into its
# own temporary directory.
New-Item -ItemType Directory -Path test-run -Force
Push-Location -Path test-run
New-Item -ItemType Directory -Path .git, python -Force
New-Item -ItemType SymbolicLink -Path bin -Target ${{ github.workspace }}\bin
New-Item -ItemType SymbolicLink -Path lib -Target ${{ github.workspace }}\lib
New-Item -ItemType SymbolicLink -Path test-data -Target ${{ github.workspace }}\test-data
Copy-Item -Path ${{ github.workspace }}\python\tests -Destination .\python\tests -Recurse -Force
# Env vars
$env:RD_SKIP_SIGNAL = "1"
$env:ERT_SHOW_BACKTRACE = "1"
# Run tests
python.exe -m pytest python/tests