@@ -52,11 +52,12 @@ jobs:
5252 fail-fast : false
5353 max-parallel : 12
5454 matrix :
55- os : [ubuntu-latest, macos-latest, windows-latest]
56- python-version : [3.8, 3.9, "3.10", "3.11"]
55+ # TODO: fix for Mac and Windows.
56+ os : [ubuntu-latest]
57+ python-version : [ 3.9, "3.10", "3.11", "3.12", "3.13"]
5758
5859 steps :
59- - uses : actions/checkout@v2
60+ - uses : actions/checkout@v4
6061 with :
6162 submodules : true
6263
@@ -65,70 +66,62 @@ jobs:
6566 with :
6667 python-version : ${{ matrix.python-version }}
6768
68- - name : Setup msbuild Windows
69- if : runner.os == 'Windows'
70- 69+ - name : Install Protobuf Compiler Linux
70+ if : runner.os == 'Linux'
71+ run : |
72+ sudo apt-get update
73+ sudo apt-get install -y protobuf-compiler libprotobuf-dev
74+ - name : Install Protobuf Compiler Mac
75+ if : runner.os == 'macOS'
76+ run : |
77+ brew install protobuf
7178
72- - name : Fix Paths Windows
73- # Make sure that tar.exe from Git is used not from Windows
79+ - name : Install Protobuf Compiler Windows
7480 if : runner.os == 'Windows'
7581 run : |
76- @("C:\Program Files\Git\usr\bin") + (Get-Content $env:GITHUB_PATH) | Set-Content $env:GITHUB_PATH -Encoding utf8
82+ $protobufVersion = "32.0"
83+ $downloadUrl = "https://github.com/protocolbuffers/protobuf/releases/download/v$protobufVersion/protoc-$protobufVersion-win64.zip"
84+ $destinationFolder = "$env:TEMP\protoc"
7785
78- - name : Cache Bazel Unix
79- # Not working on Windows: https://github.com/actions/cache/issues/576
80- if : runner.os != 'Windows'
81- 82- with :
83- path : |
84- ./bazel-PyDP
85- ./bazel-bin
86- ./bazel-cache
87- ./bazel-out
88- key : ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}
89-
90- - name : Update environment variables Windows
86+ Invoke-WebRequest -Uri $downloadUrl -OutFile protoc.zip
87+ Expand-Archive -Path protoc.zip -DestinationPath $destinationFolder
88+
89+ # Add the protoc directory to the PATH
90+ echo "$destinationFolder\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
91+
92+ - name : Verify protoc installation
93+ run : protoc --version
94+
95+ - name : Download proto header Windows
9196 if : runner.os == 'Windows'
92- # See:
93- # - On Bazel cache: https://docs.bazel.build/versions/master/output_directories.html
94- run : |
95- echo "BAZEL_CACHE_DIR=$env:USERPROFILE\_bazel_$env:USERNAME" >> $env:GITHUB_ENV
97+ run : vcpkg install protobuf:x64-windows
98+
99+ - name : Setup msbuild Windows
100+ if : runner.os == 'Windows'
101+ 96102
97- - name : Cache Bazel Windows
103+ - name : Setup Visual studio Windows
98104 if : runner.os == 'Windows'
99- # https://stackoverflow.com/questions/66870002/github-actions-cache-maven-m2-repository-on-windows-environment-c-users-run
100- 101- with :
102- path : |
103- ./bazel-cache
104- key : ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}
105+ uses : ilammy/msvc-dev-cmd@v1
105106
106107 - name : Build Google DP Unix
107108 if : runner.os != 'Windows'
108109 timeout-minutes : 20
109110 run : |
110- PYTHONHOME=$(which python)
111- PYTHONPATH=$(python -c "import sys; print([x for x in sys.path if 'site-packages' in x][0]);")
112- BAZEL_CONFIG_OS=$(python -c "print('${{ matrix.os }}'.split('-')[0].lower().replace('ubuntu', 'linux'))")
113- echo "Running: ${{ matrix.os }}"
114- echo "Using BAZEL_CONFIG_OS: $BAZEL_CONFIG_OS"
115- bazel --output_base ./bazel-cache build src/python:pydp \
116- --config $BAZEL_CONFIG_OS \
117- --verbose_failures --action_env=PYTHON_BIN_PATH=$PYTHONHOME \
118- --action_env=PYTHON_LIB_PATH=$PYTHONPATH
119- cp -f ./bazel-bin/src/bindings/_pydp.so ./src/pydp
111+ bash build_PyDP.sh
120112
121113 - name : Build Google DP Windows
122114 if : runner.os == 'Windows'
123115 timeout-minutes : 20
124116 run : |
125- $PYTHONHOME=$(python -c 'import sys; print(sys.executable);').replace('\', '/')
126- $PYTHONPATH=$(python -c "import sys; print([x for x in sys.path if 'site-packages' in x][0]);").replace('\', '/')
127- echo "PYTHONHOME=$PYTHONHOME"
128- echo "PYTHONPATH=$PYTHONPATH"
129117 echo "Running: ${{ matrix.os }}"
130- bazel.exe --output_base ./bazel-cache build src/python:pydp --config windows --verbose_failures --action_env=PYTHON_BIN_PATH=$PYTHONHOME --action_env=PYTHON_LIB_PATH=$PYTHONPATH
131- copy ./bazel-bin/src/bindings/_pydp.so ./src/pydp/_pydp.pyd
118+ mkdir build
119+ cd build
120+ cmake .. -DCMAKE_BUILD_TYPE=Release
121+ cmake --build . --config Release -j
122+ echo %CD%
123+ dir
124+ move /Y .\src\bindings\PyDP\_pydp.pyd ..\src\pydp\_pydp.pyd
132125
133126 - name : Upgrade pip
134127 run : |
@@ -144,7 +137,7 @@ jobs:
144137 echo "::set-output name=dir::$(poetry config cache-dir)"
145138
146139 - name : poetry cache
147- uses : actions/cache@v2
140+ uses : actions/cache@v4
148141 with :
149142 path : ${{ steps.poetry-cache.outputs.dir }}
150143 key : ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
@@ -153,7 +146,7 @@ jobs:
153146
154147 - name : Install dependencies
155148 run : |
156- poetry config installer.modern-installation false
149+ poetry lock
157150 poetry install
158151
159152 - name : Build PyDP macOS
0 commit comments