From c6eb290f214d381c016afb159b871ec89175a933 Mon Sep 17 00:00:00 2001 From: Romkisel Date: Thu, 14 Apr 2022 17:38:23 +0300 Subject: [PATCH 1/2] python tests --- .github/workflows/dxapi-python-build.yml | 345 ++++++++++++++--------- 1 file changed, 206 insertions(+), 139 deletions(-) diff --git a/.github/workflows/dxapi-python-build.yml b/.github/workflows/dxapi-python-build.yml index aef2b79..cea1983 100644 --- a/.github/workflows/dxapi-python-build.yml +++ b/.github/workflows/dxapi-python-build.yml @@ -37,154 +37,154 @@ jobs: name: dxapi-${{ matrix.os }} path: ./dxapi/bin/libdxapi-x64.a - build-windows-dxapi: - runs-on: windows-2019 - steps: - - name: Check out repository code - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - name: Use MSBuild - uses: microsoft/setup-msbuild@v1.1 - - name: Build Solution - run: msbuild ./dxapi/dxapi.sln /p:configuration=release /p:platform=x64 /t:rebuild - - name: Archive artifacts - uses: actions/upload-artifact@v2 - with: - name: dxapi-windows - path: ./dxapi/bin/dxapi-x64.lib +# build-windows-dxapi: +# runs-on: windows-2019 +# steps: +# - name: Check out repository code +# uses: actions/checkout@v2 +# with: +# submodules: 'recursive' +# - name: Use MSBuild +# uses: microsoft/setup-msbuild@v1.1 +# - name: Build Solution +# run: msbuild ./dxapi/dxapi.sln /p:configuration=release /p:platform=x64 /t:rebuild +# - name: Archive artifacts +# uses: actions/upload-artifact@v2 +# with: +# name: dxapi-windows +# path: ./dxapi/bin/dxapi-x64.lib - build-dxapi-python-linux: - runs-on: ubuntu-latest - needs: [build-dxapi] - strategy: - matrix: - py: ['3.6', '3.7', '3.8', '3.9', '3.10'] - include: - - py: '3.6' - py_env: '36' - - py: '3.7' - py_env: '37' - - py: '3.8' - py_env: '38' - - py: '3.9' - py_env: '39' - - py: '3.10' - py_env: '310' - steps: - - name: Check out repository code - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - name: Download dxapi-linux artifacts - uses: actions/download-artifact@v2 - with: - name: dxapi-ubuntu-latest - path: dxapi/bin - - name: install dev python 3.8, 3.9 - if: ${{ matrix.py == '3.8' || matrix.py == '3.9' }} - run: | - sudo apt-get update - sudo apt install -y python${{ matrix.py }}-dev - - name: install dev python 3.6, 3.7, 3.10 - if: ${{ matrix.py == '3.6' || matrix.py == '3.7' || matrix.py == '3.10' }} - run: | - sudo apt-get update - sudo apt-get install -yq software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.py }}-dev - - name: Build Dxapi - run: | - make -C . - cp ./dfp/lib/linux/64/libDecimalNative.so ./bin/release/linux/x64/py${{ matrix.py_env }}/ - env: - CC: clang - PYTHON_VERSION: ${{ matrix.py_env }} - - name: Archive artifacts - uses: actions/upload-artifact@v2 - with: - name: dxapi-python-linux - path: | - ./bin/release/__init__.py - ./bin/release/linux/x64/py${{ matrix.py_env }}/_dxapi.so - ./bin/release/linux/x64/py${{ matrix.py_env }}/libDecimalNative.so +# build-dxapi-python-linux: +# runs-on: ubuntu-latest +# needs: [build-dxapi] +# strategy: +# matrix: +# py: ['3.6', '3.7', '3.8', '3.9', '3.10'] +# include: +# - py: '3.6' +# py_env: '36' +# - py: '3.7' +# py_env: '37' +# - py: '3.8' +# py_env: '38' +# - py: '3.9' +# py_env: '39' +# - py: '3.10' +# py_env: '310' +# steps: +# - name: Check out repository code +# uses: actions/checkout@v2 +# with: +# submodules: 'recursive' +# - name: Download dxapi-linux artifacts +# uses: actions/download-artifact@v2 +# with: +# name: dxapi-ubuntu-latest +# path: dxapi/bin +# - name: install dev python 3.8, 3.9 +# if: ${{ matrix.py == '3.8' || matrix.py == '3.9' }} +# run: | +# sudo apt-get update +# sudo apt install -y python${{ matrix.py }}-dev +# - name: install dev python 3.6, 3.7, 3.10 +# if: ${{ matrix.py == '3.6' || matrix.py == '3.7' || matrix.py == '3.10' }} +# run: | +# sudo apt-get update +# sudo apt-get install -yq software-properties-common +# sudo add-apt-repository ppa:deadsnakes/ppa +# sudo apt-get update +# sudo apt-get install python${{ matrix.py }}-dev +# - name: Build Dxapi +# run: | +# make -C . +# cp ./dfp/lib/linux/64/libDecimalNative.so ./bin/release/linux/x64/py${{ matrix.py_env }}/ +# env: +# CC: clang +# PYTHON_VERSION: ${{ matrix.py_env }} +# - name: Archive artifacts +# uses: actions/upload-artifact@v2 +# with: +# name: dxapi-python-linux +# path: | +# ./bin/release/__init__.py +# ./bin/release/linux/x64/py${{ matrix.py_env }}/_dxapi.so +# ./bin/release/linux/x64/py${{ matrix.py_env }}/libDecimalNative.so - build-dxapi-python-windows: - runs-on: windows-2019 - needs: [build-windows-dxapi] - strategy: - matrix: - py: ['3.6', '3.7', '3.8', '3.9', '3.10'] - include: - - py: '3.6' - py_env: '36' - - py: '3.7' - py_env: '37' - - py: '3.8' - py_env: '38' - - py: '3.9' - py_env: '39' - - py: '3.10' - py_env: '310' - steps: - - name: Check out repository code - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - name: Download dxapi-windows artifacts - uses: actions/download-artifact@v2 - with: - name: dxapi-windows - path: dxapi/bin - - uses: actions/setup-python@v2 - with: - python-version: '${{ matrix.py }}' - - name: Use MSBuild - uses: microsoft/setup-msbuild@v1.1 - - name: Build Solution - run: | - Expand-Archive -Path ./swigwin/swigwin-3.0.12.zip -DestinationPath ./swigwin -Force - $pwd = pwd - $Env:SWIG_HOME="$pwd/swigwin/swigwin-3.0.12" - $Env:SWIG_HOME - python --version - python -c "import os, sys; print(os.path.dirname(sys.executable))" - $Env:PYTHON${{ matrix.py_env }}_HOME=python -c "import os, sys; print(os.path.dirname(sys.executable))" - $Env:PYTHON${{ matrix.py_env }}_HOME - msbuild ./dxapi-python.sln /p:configuration=Release${{ matrix.py_env }} /p:platform=x64 /t:rebuild - - name: Archive artifacts - uses: actions/upload-artifact@v2 - with: - name: dxapi-python-windows - path: | - ./bin/release/__init__.py - ./bin/release/windows/x64/py${{ matrix.py_env }}/_dxapi.pyd - ./bin/release/windows/x64/py${{ matrix.py_env }}/DecimalNative.dll +# build-dxapi-python-windows: +# runs-on: windows-2019 +# needs: [build-windows-dxapi] +# strategy: +# matrix: +# py: ['3.6', '3.7', '3.8', '3.9', '3.10'] +# include: +# - py: '3.6' +# py_env: '36' +# - py: '3.7' +# py_env: '37' +# - py: '3.8' +# py_env: '38' +# - py: '3.9' +# py_env: '39' +# - py: '3.10' +# py_env: '310' +# steps: +# - name: Check out repository code +# uses: actions/checkout@v2 +# with: +# submodules: 'recursive' +# - name: Download dxapi-windows artifacts +# uses: actions/download-artifact@v2 +# with: +# name: dxapi-windows +# path: dxapi/bin +# - uses: actions/setup-python@v2 +# with: +# python-version: '${{ matrix.py }}' +# - name: Use MSBuild +# uses: microsoft/setup-msbuild@v1.1 +# - name: Build Solution +# run: | +# Expand-Archive -Path ./swigwin/swigwin-3.0.12.zip -DestinationPath ./swigwin -Force +# $pwd = pwd +# $Env:SWIG_HOME="$pwd/swigwin/swigwin-3.0.12" +# $Env:SWIG_HOME +# python --version +# python -c "import os, sys; print(os.path.dirname(sys.executable))" +# $Env:PYTHON${{ matrix.py_env }}_HOME=python -c "import os, sys; print(os.path.dirname(sys.executable))" +# $Env:PYTHON${{ matrix.py_env }}_HOME +# msbuild ./dxapi-python.sln /p:configuration=Release${{ matrix.py_env }} /p:platform=x64 /t:rebuild +# - name: Archive artifacts +# uses: actions/upload-artifact@v2 +# with: +# name: dxapi-python-windows +# path: | +# ./bin/release/__init__.py +# ./bin/release/windows/x64/py${{ matrix.py_env }}/_dxapi.pyd +# ./bin/release/windows/x64/py${{ matrix.py_env }}/DecimalNative.dll build-dxapi-python-macos: runs-on: macos-latest needs: [build-dxapi] strategy: matrix: - py: ['3.6', '3.7', '3.8', '3.9', '3.10'] + py: ['3.10'] #['3.6', '3.7', '3.8', '3.9', '3.10'] include: - - py: '3.6' - py_env: '36' - py_v: '3.6.15' - py_lib_prefix: '3.6m' - - py: '3.7' - py_env: '37' - py_v: '3.7.12' - py_lib_prefix: '3.7m' - - py: '3.8' - py_env: '38' - py_v: '3.8.12' - py_lib_prefix: '3.8' - - py: '3.9' - py_env: '39' - py_v: '3.9.10' - py_lib_prefix: '3.9' +# - py: '3.6' +# py_env: '36' +# py_v: '3.6.15' +# py_lib_prefix: '3.6m' +# - py: '3.7' +# py_env: '37' +# py_v: '3.7.12' +# py_lib_prefix: '3.7m' +# - py: '3.8' +# py_env: '38' +# py_v: '3.8.12' +# py_lib_prefix: '3.8' +# - py: '3.9' +# py_env: '39' +# py_v: '3.9.10' +# py_lib_prefix: '3.9' - py: '3.10' py_env: '310' py_v: '3.10.2' @@ -272,3 +272,70 @@ jobs: name: test-reports-dxapi-python-linux path: | ./tests/reports + + test-dxapi-python-macos: + runs-on: macos-latest + needs: [build-dxapi-python-macos] + strategy: + matrix: + py: ['3.10'] #['3.6', '3.7', '3.8', '3.9', '3.10'] + include: +# - py: '3.6' +# py_env: '36' +# py_v: '3.6.15' +# py_lib_prefix: '3.6m' +# - py: '3.7' +# py_env: '37' +# py_v: '3.7.12' +# py_lib_prefix: '3.7m' +# - py: '3.8' +# py_env: '38' +# py_v: '3.8.12' +# py_lib_prefix: '3.8' +# - py: '3.9' +# py_env: '39' +# py_v: '3.9.10' +# py_lib_prefix: '3.9' + - py: '3.10' + py_env: '310' + py_v: '3.10.2' + py_lib_prefix: '3.10' +# services: +# timebase: +# image: finos/timebase-ce-server:6.1 +# env: +# JAVA_OPTS: "-DQuantServer.enableRemoteMonitoring=true -DTimeBase.version=5.0" +# ports: +# - 8011:8011 + steps: + - name: Check out repository code + uses: actions/checkout@v2 + with: + submodules: 'recursive' + - name: Download dxapi-python-macos artifacts + uses: actions/download-artifact@v2 + with: + name: dxapi-python-macos + path: tests/dxapi + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.py_v }} + - name: Run tests + run: | + mkdir /Library/Frameworks/Python.framework/Versions/${{ matrix.py }} + ln -s /Users/runner/hostedtoolcache/Python/${{ matrix.py_v }}/x64/include/python${{ matrix.py_lib_prefix }} /Library/Frameworks/Python.framework/Versions/${{ matrix.py }} + mv /Library/Frameworks/Python.framework/Versions/${{ matrix.py }}/python${{ matrix.py_lib_prefix }} /Library/Frameworks/Python.framework/Versions/${{ matrix.py }}/Headers + ln -s /Users/runner/hostedtoolcache/Python/${{ matrix.py_v }}/x64/lib /Library/Frameworks/Python.framework/Versions/${{ matrix.py }} + docker run --name tb -d finos/timebase-ce-server + chmod -R 777 ./tests + cd ./tests + python TestAll.py + env: + TIMEBASE_HOST: localhost + TIMEBASE_PORT: 8011 + - name: Archive artifacts + uses: actions/upload-artifact@v2 + with: + name: test-reports-dxapi-python-linux + path: | + ./tests/reports From d6bff11e19ee311dcdbc079dab82ba2308ba1abb Mon Sep 17 00:00:00 2001 From: Romkisel Date: Thu, 14 Apr 2022 17:39:30 +0300 Subject: [PATCH 2/2] python tests --- .github/workflows/dxapi-python-build.yml | 80 ++++++++++++------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/dxapi-python-build.yml b/.github/workflows/dxapi-python-build.yml index cea1983..e54c9bf 100644 --- a/.github/workflows/dxapi-python-build.yml +++ b/.github/workflows/dxapi-python-build.yml @@ -232,46 +232,46 @@ jobs: ./bin/release/darwin/x64/py${{ matrix.py_env }}/libDecimalNative.dylib # Tests - test-dxapi-python-linux: - runs-on: ubuntu-latest - needs: [build-dxapi-python-linux] - strategy: - matrix: - py: ['3.6', '3.7', '3.8', '3.9', '3.10'] - services: - timebase: - image: finos/timebase-ce-server:6.1 - env: - JAVA_OPTS: "-DQuantServer.enableRemoteMonitoring=true -DTimeBase.version=5.0" - ports: - - 8011:8011 - steps: - - name: Check out repository code - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - name: Download dxapi-python-linux artifacts - uses: actions/download-artifact@v2 - with: - name: dxapi-python-linux - path: tests/dxapi - - uses: actions/setup-python@v2 - with: - python-version: '${{ matrix.py }}' - - name: Run tests - run: | - chmod -R 777 ./tests - cd ./tests - python TestAll.py - env: - TIMEBASE_HOST: localhost - TIMEBASE_PORT: 8011 - - name: Archive artifacts - uses: actions/upload-artifact@v2 - with: - name: test-reports-dxapi-python-linux - path: | - ./tests/reports +# test-dxapi-python-linux: +# runs-on: ubuntu-latest +# needs: [build-dxapi-python-linux] +# strategy: +# matrix: +# py: ['3.6', '3.7', '3.8', '3.9', '3.10'] +# services: +# timebase: +# image: finos/timebase-ce-server:6.1 +# env: +# JAVA_OPTS: "-DQuantServer.enableRemoteMonitoring=true -DTimeBase.version=5.0" +# ports: +# - 8011:8011 +# steps: +# - name: Check out repository code +# uses: actions/checkout@v2 +# with: +# submodules: 'recursive' +# - name: Download dxapi-python-linux artifacts +# uses: actions/download-artifact@v2 +# with: +# name: dxapi-python-linux +# path: tests/dxapi +# - uses: actions/setup-python@v2 +# with: +# python-version: '${{ matrix.py }}' +# - name: Run tests +# run: | +# chmod -R 777 ./tests +# cd ./tests +# python TestAll.py +# env: +# TIMEBASE_HOST: localhost +# TIMEBASE_PORT: 8011 +# - name: Archive artifacts +# uses: actions/upload-artifact@v2 +# with: +# name: test-reports-dxapi-python-linux +# path: | +# ./tests/reports test-dxapi-python-macos: runs-on: macos-latest