Skip to content

Add the wheelhouse in the unit_tests workflow. #1182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
key: Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements/requirements_tests*.txt') }}
restore-keys: |
Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.python-version }}

- name: Install PyAEDT
run: pip install .

Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ name: CI
env:
python.version: 3.8
python.venv: 'testvenv'
# Following env vars when changed will "reset" the mentioned cache,
# by changing the cache file name. It is rendered as ...-v%RESET_XXX%-...
# You should go up in number, if you go down (or repeat a previous value)
# you might end up reusing a previous cache if it haven't been deleted already.
# It applies 7 days retention policy by default.
RESET_PIP_CACHE: 0
PACKAGE_NAME: PyAEDT
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
Expand Down Expand Up @@ -35,6 +42,56 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Linux pip cache
uses: actions/cache@v2
if: ${{ runner.os == 'Linux' }}
with:
path: ~/.cache/pip
key: Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements_tests.txt') }}
restore-keys: |
Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.python-version }}

- name: Window pip cache
uses: actions/cache@v2
if: ${{ runner.os == 'Windows' }}
with:
path: ~\AppData\Local\pip\Cache
key: Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements_tests*.txt') }}
restore-keys: |
Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.python-version }}

- name: Install PyAEDT
run: pip install .

# - name: Test import
# working-directory: tests
# run: python -c "import pyaedt"

- name: Retrieve PyAEDT version
run: |
echo "::set-output name=PYAEDT_VERSION::$(python -c "from pyaedt import __version__; print(__version__)")"
echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")"
id: version

- name: Generate wheelhouse
run: |
pip install wheel setuptools -U
pip wheel . -w wheelhouse


- name: Zip wheelhouse
uses: vimtor/action-zip@v1
with:
files: wheelhouse
dest: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}.zip

- name: Upload Wheelhouse
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}
path: '*.zip'
retention-days: 7

- name: 'Create virtual env'
run: |
python -m venv testenv
Expand Down Expand Up @@ -107,3 +164,13 @@ jobs:
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

- name: Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
files: |
./**/*.whl
./**/*.tar.gz
./**/*.pdf
./**/*.zip