Skip to content

Commit

Permalink
Test upload of wheelhouse
Browse files Browse the repository at this point in the history
  • Loading branch information
PProfizi committed Sep 20, 2023
1 parent bc6c39d commit dfec5c2
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 128 deletions.
106 changes: 27 additions & 79 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
# 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/[email protected]
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
Expand All @@ -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
Expand All @@ -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

Expand Down
104 changes: 55 additions & 49 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
# 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/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: "Install DPF"
id: set-server-path
uses: ansys/pydpf-actions/[email protected]
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'
Expand All @@ -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/[email protected]

- 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/[email protected]
with:
files: dist
dest: ${{ steps.wheel.outputs.wheel_name }}_wheelhouse.zip

- name: "Prepare Testing Environment"
uses: ansys/pydpf-actions/[email protected]
- name: "Upload wheelhouse to artifacts"
if: inputs.wheelhouse == 'true'
uses: actions/[email protected]
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/[email protected]
with:
MODULE: ${{env.MODULE}}
PACKAGE_NAME: ${{env.PACKAGE_NAME}}
working-directory: src
# - name: "Install DPF"
# id: set-server-path
# uses: ansys/pydpf-actions/[email protected]
# 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/[email protected]
#
# - name: "Test import"
# shell: bash
# working-directory: tests
# run: python -c "from ansys.dpf import core"
#
# - name: "Prepare Testing Environment"
# uses: ansys/pydpf-actions/[email protected]
# with:
# DEBUG: true
#
# - name: "List installed packages"
# shell: bash
# run: pip list
#
# - name: "Test Docstrings"
# if: inputs.DOCSTRING == 'true'
# uses: ansys/pydpf-actions/[email protected]
# with:
# MODULE: ${{env.MODULE}}
# PACKAGE_NAME: ${{env.PACKAGE_NAME}}
# working-directory: src
#
# - name: "Separate long Core tests"
# shell: pwsh
Expand Down

0 comments on commit dfec5c2

Please sign in to comment.