From dfec5c2f0ecc87d5d4164c194ab787f4a0d7fb10 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Wed, 20 Sep 2023 16:16:08 +0200 Subject: [PATCH] Test upload of wheelhouse --- .github/workflows/ci.yml | 106 +++++++++--------------------------- .github/workflows/tests.yml | 104 ++++++++++++++++++----------------- 2 files changed, 82 insertions(+), 128 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6bac5d9cdc..fbdad63594 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,33 +25,33 @@ env: MAIN_PYTHON_VERSION: '3.8' jobs: -# debug: -# runs-on: ubuntu-latest -# steps: -# - name: Show the Github context for the triggered event -# run: echo "$GITHUB_CONTEXT" -# env: -# GITHUB_CONTEXT: ${{ toJson(github) }} -# -# style: -# name: "Style Check" -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# -# - name: "Setup Python" -# uses: actions/setup-python@v4.6.0 -# with: -# python-version: ${{ env.MAIN_PYTHON_VERSION }} -# -# - name: "Install pre-commit" -# run: pip install pre-commit -# -# - name: "Run pre-commit" -# run: pre-commit run --all-files --show-diff-on-failure + debug: + runs-on: ubuntu-latest + steps: + - name: Show the Github context for the triggered event + run: echo "$GITHUB_CONTEXT" + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + + style: + name: "Style Check" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: "Setup Python" + uses: actions/setup-python@v4.6.0 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + + - name: "Install pre-commit" + run: pip install pre-commit + + - name: "Run pre-commit" + run: pre-commit run --all-files --show-diff-on-failure build_any: - name: "Build any wheels for the package" + name: "Build wheel any" runs-on: ubuntu-latest env: platform: any @@ -78,34 +78,8 @@ jobs: name: ${{ steps.wheel.outputs.wheel_name }} path: dist/${{ steps.wheel.outputs.wheel_name }} -# build_win: -# name: "Build win wheels for the package" -# runs-on: windows-latest -# steps: -# - uses: actions/checkout@v3 -# -# - name: "Install requirements" -# run: pip install -r requirements/requirements_build.txt -# -# - name: "Build the wheel" -# shell: bash -# id: wheel -# run: | -# python .ci/build_wheel.py -p win -# cd dist -# export name=`ls ansys_dpf_core*.whl` -# echo ${name} -# echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT -# cd .. -# -# - name: "Upload wheel any as artifact" -# uses: actions/upload-artifact@v3 -# with: -# name: ${{ steps.wheel.outputs.wheel_name }} -# path: dist/${{ steps.wheel.outputs.wheel_name }} - build_linux1: - name: "Build linux1 wheels for the package" + name: "Build linux1 wheel" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -130,39 +104,13 @@ jobs: name: ${{ steps.wheel.outputs.wheel_name }} path: dist/${{ steps.wheel.outputs.wheel_name }} -# build_linux2: -# name: "Build linux2 wheels for the package" -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# -# - name: "Install requirements" -# run: pip install -r requirements/requirements_build.txt -# -# - name: "Build the manylinux_2_17 wheel" -# shell: bash -# id: wheel -# run: | -# python .ci/build_wheel.py -p manylinux_2_17 -# cd dist -# export name=`ls ansys_dpf_core*.whl` -# echo ${name} -# echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT -# cd .. -# -# - name: "Upload wheel any as artifact" -# uses: actions/upload-artifact@v3 -# with: -# name: ${{ steps.wheel.outputs.wheel_name }} -# path: dist/${{ steps.wheel.outputs.wheel_name }} - tests: uses: ./.github/workflows/tests.yml with: ANSYS_VERSION: "241" python_versions: '["3.8"]' wheel: true - wheelhouse: false + wheelhouse: true standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }} secrets: inherit diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bda27ed82a..0e669a39a5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -96,51 +96,34 @@ jobs: shell: bash run: | echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV - echo "ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }}" >> $GITHUB_ENV - -# - name: "Build Package" -# uses: ansys/pydpf-actions/build_package@v2.3 -# with: -# ANSYS_VERSION: ${{inputs.ANSYS_VERSION}} -# PACKAGE_NAME: ${{env.PACKAGE_NAME}} -# MODULE: ${{env.MODULE}} -# dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}} -# install_extras: plotting -# wheel: ${{ inputs.wheel }} -# wheelhouse: ${{ inputs.wheelhouse }} -# standalone_suffix: ${{ inputs.standalone_suffix }} + echo "ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }}" >> $GITHUB_ENV - name: "Setup Python" uses: actions/setup-python@v4.6.1 with: python-version: ${{ matrix.python-version }} - - name: "Install DPF" - id: set-server-path - uses: ansys/pydpf-actions/install-dpf-server@v2.3 - with: - dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}} - standalone_suffix: ${{ inputs.standalone_suffix }} - ANSYS_VERSION : ${{inputs.ANSYS_VERSION}} - - name: "Install requirements" run: pip install -r requirements/requirements_build.txt - name: "Build the wheel" shell: bash - id: wheel run: | if [ ${{ matrix.os }} == "ubuntu-latest" ]; then export platform="manylinux_2_17" else export platform="win" fi - python .ci/build_wheel.py -p $platform - cd dist + python .ci/build_wheel.py -p $platform -w + + - name: "Expose the wheel" + shell: bash + id: wheel + working-directory: dist + run: | export name=`ls ansys_dpf_core*.whl` echo ${name} echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT - cd .. - name: "Upload wheel to artifacts" if: inputs.wheel == 'true' @@ -149,35 +132,58 @@ jobs: name: ${{ steps.wheel.outputs.wheel_name }} path: dist/${{ steps.wheel.outputs.wheel_name }} - - name: "Install package wheel" - shell: bash - run: | - pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] - - - name: "Check licences of packages" - uses: ansys/pydpf-actions/check-licenses@v2.3 - - - name: "Test import" - shell: bash - working-directory: tests - run: python -c "from ansys.dpf import core" + - name: "Zip wheelhouse" + if: inputs.wheelhouse == 'true' + uses: vimtor/action-zip@v1.1 + with: + files: dist + dest: ${{ steps.wheel.outputs.wheel_name }}_wheelhouse.zip - - name: "Prepare Testing Environment" - uses: ansys/pydpf-actions/prepare_tests@v2.3 + - name: "Upload wheelhouse to artifacts" + if: inputs.wheelhouse == 'true' + uses: actions/upload-artifact@v3.1.2 with: - DEBUG: true + name: ${{ steps.wheel.outputs.wheel_name }}_wheelhouse + path: ${{ steps.wheel.outputs.wheel_name }}_wheelhouse.zip + retention-days: 7 - - name: "List installed packages" + - name: "Install package wheel" shell: bash - run: pip list + run: | + pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] - - name: "Test Docstrings" - if: inputs.DOCSTRING == 'true' - uses: ansys/pydpf-actions/test_docstrings@v2.3 - with: - MODULE: ${{env.MODULE}} - PACKAGE_NAME: ${{env.PACKAGE_NAME}} - working-directory: src +# - name: "Install DPF" +# id: set-server-path +# uses: ansys/pydpf-actions/install-dpf-server@v2.3 +# with: +# dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}} +# standalone_suffix: ${{ inputs.standalone_suffix }} +# ANSYS_VERSION : ${{inputs.ANSYS_VERSION}} +# +# - name: "Check licences of packages" +# uses: ansys/pydpf-actions/check-licenses@v2.3 +# +# - name: "Test import" +# shell: bash +# working-directory: tests +# run: python -c "from ansys.dpf import core" +# +# - name: "Prepare Testing Environment" +# uses: ansys/pydpf-actions/prepare_tests@v2.3 +# with: +# DEBUG: true +# +# - name: "List installed packages" +# shell: bash +# run: pip list +# +# - name: "Test Docstrings" +# if: inputs.DOCSTRING == 'true' +# uses: ansys/pydpf-actions/test_docstrings@v2.3 +# with: +# MODULE: ${{env.MODULE}} +# PACKAGE_NAME: ${{env.PACKAGE_NAME}} +# working-directory: src # # - name: "Separate long Core tests" # shell: pwsh