-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from WISDEM/develop
Develop
- Loading branch information
Showing
15 changed files
with
411 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,85 +5,109 @@ on: [push, pull_request] | |
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
build_conda: | ||
name: Build (${{ matrix.os }} Python ${{ matrix.python-version }}) | ||
build_pip: | ||
name: Pip Build (${{ matrix.os }}) - ${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
strategy: | ||
fail-fast: False | ||
fail-fast: false #true | ||
matrix: | ||
os: ["ubuntu-latest", "windows-latest"] | ||
python-version: ["3.8", "3.9", "3.10"] | ||
os: ["ubuntu-latest", "macOS-latest", "windows-latest"] | ||
python-version: ["3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- name: Setup C/C++ Compiler | ||
id: install_cc | ||
uses: rlalik/[email protected] | ||
with: | ||
compiler: gcc #clang | ||
|
||
- name: checkout repository | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
id: cp | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
update-environment: true | ||
|
||
# Official way to do miniconda, but it messes with the worker environment and shell | ||
- name: Install miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
- name: Pip Install pyFrame3DD | ||
env: | ||
MESON_ARGS: -Dpython_target=${{ steps.cp.outputs.python-path }} | ||
CC: '${{ steps.install_cc.outputs.cc }}' | ||
CXX: '${{ steps.install_cc.outputs.cxx }}' | ||
run: | | ||
'${{ steps.cp.outputs.python-path }}' -m pip install -vv .[test] | ||
- name: Test run | ||
run: | | ||
'${{ steps.cp.outputs.python-path }}' -m pytest test | ||
build_conda: | ||
name: Conda Build (${{ matrix.os }}) - ${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
|
||
strategy: | ||
fail-fast: false #true | ||
matrix: | ||
os: ["ubuntu-latest", "macOS-latest", "windows-latest"] | ||
python-version: ["3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
# https://github.com/marketplace/actions/setup-miniconda | ||
with: | ||
miniconda-version: "latest" | ||
channels: conda-forge | ||
#mamba-version: "*" | ||
miniforge-version: "latest" | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
environment-file: environment.yml | ||
activate-environment: test | ||
auto-activate-base: false | ||
|
||
# This is a less official, but more lightweight way to do miniconda | ||
#- name: Install miniconda | ||
# uses: s-weigand/setup-conda@v1 | ||
# # https://github.com/marketplace/actions/setup-conda | ||
# with: | ||
# update-conda: true | ||
# python-version: ${{ matrix.python-version }} | ||
# conda-channels: conda-forge | ||
# activate-conda: true | ||
# | ||
#- name: Update environment | ||
# run: | | ||
# conda env update --file environment.yml | ||
# Install dependencies of WISDEM specific to windows | ||
- name: Add dependencies windows specific | ||
if: contains( matrix.os, 'windows') | ||
run: | | ||
conda install -y m2w64-toolchain libpython | ||
# Install compilers | ||
- name: Add compilers | ||
# Install dependencies of WISDEM specific to windows | ||
- name: Add dependencies mac specific | ||
if: false == contains( matrix.os, 'windows') | ||
run: | | ||
conda install compilers | ||
conda install -y compilers | ||
# Install dependencies of WISDEM specific to linux/mac | ||
#- name: Add dependencies linux specific | ||
# if: false == contains( matrix.os, 'windows') | ||
# run: | | ||
# conda install ninja | ||
# conda init bash | ||
# Install | ||
- name: Debug | ||
run: | | ||
conda list | ||
printenv | ||
# Install dependencies of WISDEM specific to windows | ||
#- name: Add dependencies windows specific | ||
#- name: Setup tmate session | ||
# uses: mxschmitt/action-tmate@v3 | ||
# with: | ||
# detached: true | ||
# if: contains( matrix.os, 'windows') | ||
# run: | | ||
# conda install -y m2w64-toolchain libpython | ||
|
||
|
||
# Install | ||
- name: Conda Install pyFrame3DD | ||
env: | ||
MESON_ARGS: "" | ||
run: | | ||
python setup.py develop | ||
# Peek | ||
#- name: Library name | ||
# run: | | ||
# ls | ||
# echo "BREAK" | ||
# ls pyframe3dd | ||
# echo "BREAK" | ||
# ls meson_build/pyframe3dd | ||
python -m pip install . | ||
# Run tests | ||
- name: Conda Run pytest | ||
- name: Test run | ||
run: | | ||
pytest test | ||
python -m pytest test | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Build and upload to PyPI | ||
|
||
# Build on every branch push, tag push, and pull request change: | ||
#on: [push, pull_request] | ||
# Alternatively, to publish when a (published) GitHub Release is created, use the following: | ||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
steps: | ||
- name: Setup C/C++ Compiler | ||
id: install_cc | ||
uses: rlalik/[email protected] | ||
with: | ||
compiler: gcc #clang | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build wheels | ||
env: | ||
CC: '${{ steps.install_cc.outputs.cc }}' | ||
CXX: '${{ steps.install_cc.outputs.cxx }}' | ||
uses: pypa/[email protected] | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build sdist | ||
run: pipx run build --sdist | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/*.tar.gz | ||
|
||
upload_pypi: | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
# upload to PyPI on every tag starting with 'v' | ||
#if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
# alternatively, to publish when a GitHub Release is created, use the following rule: | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
# unpacks default artifact into dist/ | ||
# if `name: artifact` is omitted, the action will create extra parent dir | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
# To test: repository_url: https://test.pypi.org/legacy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,6 @@ nosetests.xml | |
.mr.developer.cfg | ||
.project | ||
.pydevproject | ||
|
||
# Emacs | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
name: test | ||
|
||
channels: | ||
- conda-forge | ||
- defaults | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.