-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (117 loc) · 4.52 KB
/
test_windows.yaml
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
109
110
111
112
113
114
115
116
117
118
---
name: Windows wheels and test x86_64
on: [workflow_dispatch]
jobs:
build_pyproj:
name: pyproj ${{ matrix.python }} ${{ matrix.os }} ${{ matrix.triplet }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ "windows-2022" ]
arch: [ "auto64" ]
python: [ "3.9", "3.10", "3.11" ]
triplet: [ "x64-windows" ]
env:
REPO_DIR: pyproj
PYPROJ_VERSION: 3.6.1
steps:
- uses: actions/checkout@v4
# - uses: actions/checkout@v4
# with:
# repository: pyproj4/pyproj
# ref: '3.6.1'
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python }}"
- name: Install with vcpkg needed library
env:
PROJ_WHEEL: true
PROJ_NETWORK: ON
PROJ_VERSION: 9.1.0
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
GDAL_VERSION: 3.7.3
shell: bash
run: |
set -x
echo ${GITHUB_WORKSPACE}
ls -lrt ${GITHUB_WORKSPACE}
cd "$VCPKG_INSTALLATION_ROOT"
git pull > nul
./bootstrap-vcpkg.bat -disableMetrics
## simple usage is to copy over the file based
## Install gdal since contains all other requirements for Fiona and proj
cp ${GITHUB_WORKSPACE}/windows/vcpkg_proj.json ${GITHUB_WORKSPACE}/windows/vcpkg.json
cat ${GITHUB_WORKSPACE}/windows/vcpkg.json
vcpkg install --feature-flags="versions,manifests" --x-manifest-root=${GITHUB_WORKSPACE}/windows --x-install-root=$VCPKG_INSTALLATION_ROOT/installed
# install ninja for cmake
#In order to use CMake + Ninja + MSVC (The Visual Studio Compiler) you need to startup a developer command prompt.
#https://stackoverflow.com/questions/76186423/how-to-setup-visual-studio-developer-command-prompt-on-github-actions
- uses: ilammy/msvc-dev-cmd@v1
- name: Install PROJ
env:
PROJ_DIR: "C:\\proj"
PROJ_DATA: "c:\\proj\\share\\proj"
PROJ_VERSION: 9.1.0
BUILD_PROJ: 1
run: |
#gci env:* | sort-object name
choco install ninja cmake
$PROJ_DIR = $Env:PROJ_DIR
mkdir $PROJ_DIR
Write-Host "Installation folder of PROJ:"$PROJ_DIR
Write-Host "TEMP folder of wheels:"$Env:TEMP
cd "$Env:GITHUB_WORKSPACE"
git clone https://github.com/OSGeo/proj.git
cd proj
git checkout $Env:PROJ_VERSION
git status
mkdir build
cd build
cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_C_FLAGS="/WX" -DCMAKE_CXX_FLAGS="/WX" -DCMAKE_TOOLCHAIN_FILE="$Env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DCMAKE_INSTALL_PREFIX="$PROJ_DIR"
ninja -v
ninja install
#
$Env:Path = "C:\vcpkg\installed\x64-windows\bin;" + $Env:Path
$Env:Path = "$PROJ_DIR\bin;" + $Env:Path
# test bin on PATH
Write-Host "PATH: "$Env:Path
Write-Host "PROJ_DIR: "$Env:PROJ_DIR
Write-Host "PROJ_DATA: "$Env:PROJ_DATA
#
proj.exe
- name: build wheel
env:
PROJ_WHEEL: true
PROJ_NETWORK: ON
PROJ_VERSION: 9.1.0
PROJ_DATA: "c:\\proj\\share\\proj"
PYPROJ_VERSION: 3.6.1
BUILD_PROJ: 1
run: |
#
cd "$Env:GITHUB_WORKSPACE"
git clone https://github.com/pyproj4/pyproj.git
cd pyproj
git checkout $Env:PYPROJ_VERSION
# NOT NEED: mkdir -p "$Env:GITHUB_WORKSPACE\pyproj\proj_dir\share"
Copy-Item -Path $Env:PROJ_DATA -Destination "$Env:GITHUB_WORKSPACE\pyproj\proj_dir\share\proj\" -Recurse
#
Write-Host "CHECK PROJ_DATA copy files"
dir "$Env:GITHUB_WORKSPACE\pyproj\proj_dir\share\proj"
Write-Host "Install python requirements"
python -m pip install delvewheel
python -m pip install -r .\requirements-dev.txt
python -m pip wheel . --wheel-dir="$Env:TEMP" --no-deps
cd "$Env:TEMP"
Write-Host "Folder Content"
ls
mkdir "$Env:GITHUB_WORKSPACE\wheelhouse"
$file=Get-ChildItem -Path .\ -Filter *.whl
unzip -l $file
delvewheel repair -v --wheel-dir "$Env:GITHUB_WORKSPACE\wheelhouse" $file
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
retention-days: 7