Skip to content

(WIP) Fix windows

(WIP) Fix windows #752

Workflow file for this run

name: Tests
on:
pull_request:
paths:
- "*.bazel"
- "*.cpp"
- "*.c"
- "*.cc"
- "*.hpp"
- "*.h"
- "*.py"
- "*.ipynb"
- "*.go"
- "*.mod"
- "*.toml"
- "*.txt"
- "setup.cfg"
- ".github/workflows/*.yml"
jobs:
linting:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install python dependencies
run: |
pip install black mypy
- name: Black
run: |
black .
- name: MyPY
run: |
mypy src tests
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@v3.3.0
with:
clang-format-version: "11"
check-path: "/src/bindings/"
fallback-style: "Google" # optional
build:
runs-on: ${{ matrix.os }}
# needs: [linting]
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [windows-latest]
python-version: [3.11, 3.12, 3.13, 3.14]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up MSVC environment # for debug
uses: ilammy/msvc-dev-cmd@v1
# - name: Setup msbuild Windows
# if: runner.os == 'Windows'
# uses: microsoft/setup-msbuild@v1.0.2
- name: Fix Paths Windows
# Make sure that tar.exe from Git is used not from Windows
if: runner.os == 'Windows'
run: |
@("C:\Program Files\Git\usr\bin") + (Get-Content $env:GITHUB_PATH) | Set-Content $env:GITHUB_PATH -Encoding utf8
- name: Build Google DP Unix
if: runner.os != 'Windows'
timeout-minutes: 20
run: |
bash build_PyDP.sh
- name: Build Google DP Windows
if: runner.os == 'Windows'
timeout-minutes: 20
run: |
.\build_windows.cmd
- name: Archive build artifacts
# more details https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
uses: actions/upload-artifact@v4
with:
name: build-py${{ matrix.python-version }}
path: |
src
retention-days: 1
- name: Upgrade pip
run: |
pip install --upgrade --user pip
- name: Install Poetry
run: |
pip install poetry
- name: Get poetry cache dir
id: poetry-cache
run: |
echo "::set-output name=dir::$(poetry config cache-dir)"
- name: poetry cache
uses: actions/cache@v4
with:
path: ${{ steps.poetry-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-
- name: Install dependencies
run: |
poetry install
- name: Build PyDP macOS
if: runner.os == 'macOS'
run: |
poetry run python setup.py build bdist_wheel --plat-name macosx_10_14_x86_64
- name: Build PyDP Linux / Windows
if: runner.os != 'macOS'
run: |
poetry run python setup.py build bdist_wheel
- name: Install Wheel Unix
if: runner.os != 'Windows'
run: |
pip install `find -L ./ -name "*.whl"`
- name: Install Wheel Windows
if: runner.os == 'Windows'
run: |
Get-ChildItem -Path ./ -Filter "*.whl" -Recurse -File | foreach {pip install $_.FullName}
- name: Import Package
run: |
python -c "import pydp; print(pydp.__version__)"
- name: Run Pytest
run: |
poetry run pytest tests -n auto