Skip to content

Commit

Permalink
Remove unused code blocks and extra whitespace from GitHub Actions wo…
Browse files Browse the repository at this point in the history
…rkflow.
  • Loading branch information
lapets committed Nov 7, 2023
1 parent 4e05337 commit b6e5ac2
Showing 1 changed file with 24 additions and 135 deletions.
159 changes: 24 additions & 135 deletions .github/workflows/lint-test-build-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,19 @@ jobs:
name: "Python ${{ matrix.PYTHON }} on manylinux2014"
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v2
-
name: "Install Python."
- uses: actions/checkout@v2
- name: "Install Python."
run: |
yum -y install wget libffi-devel patchelf
/opt/python/${{ matrix.PYTHON }}/bin/python -m pip install virtualenv
/opt/python/${{ matrix.PYTHON }}/bin/python -m virtualenv .venv
-
name: "Install Python dependencies for build process."
- name: "Install Python dependencies for build process."
run: ".venv/bin/pip install -U pip setuptools wheel build"
-
name: "Download mcl source tree archive and extract it."
- name: "Download mcl source tree archive and extract it."
run: |
wget https://github.com/herumi/mcl/archive/refs/tags/v1.61.tar.gz
tar -xvzf *.tar.gz
-
name: "Build wheel file."
- name: "Build wheel file."
run: |
# Compile platform-dependent binaries.
cd mcl*
Expand All @@ -40,7 +35,6 @@ jobs:
cp mcl-*/lib/libmclbn256.so mclbn256
cp mcl-*/lib/libmcl.so mclbn256/lib
#
# Allow relative linking of libmcl.so dependency (also likely unused, but changing a link is easier than deleting one)
#
Expand Down Expand Up @@ -73,28 +67,8 @@ jobs:
echo "Files linked to from libmclbn256.so"
patchelf --print-needed mclbn256/libmclbn256.so # the lib/libmcl.so dependency should be relative now
# # Build
# .venv/bin/python -m build
# mkdir tmpwheelhouse
# mv dist/mclbn*.whl tmpwheelhouse
mkdir lib; cp mcl-*/lib/libmcl.so lib
# mkdir tmpwheelhouse/lib; cp mcl-*/lib/libmcl.so tmpwheelhouse/lib
# cp mcl-*/lib/libmcl.so /usr/local/bin
# auditwheel repair tmpwheelhouse/mclbn*.whl -w wheelhouse/
# # mkdir wheelhouse
# # mv dist/mclbn*.whl wheelhouse
# -
# name: "Test wheel installation."
# run: |
# ls wheelhouse
# unzip -Zl wheelhouse/*.whl
# # ls -R wheelhouse
# .venv/bin/pip install -f wheelhouse --no-index mclbn256
-
env:
- env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
name: "Lint and test module (and compiled MCl shared library files)."
run: |
Expand All @@ -104,16 +78,6 @@ jobs:
#.venv/bin/python mclbn256/mclbn256.py -v # Run doctests.
#.venv/bin/python -m nose --cover-erase # Test using nose.
#.venv/bin/python -m coveralls --service=github # Submit to coveralls.
# -
# name: "Upload wheel file."
# run: |
# mkdir mclbn-wheelhouse
# mv wheelhouse/mclbn*.whl mclbn-wheelhouse/
# -
# uses: actions/upload-artifact@v1
# with:
# name: "mclbn256-0.3.3-manylinux1-${{ matrix.PYTHON }}"
# path: mclbn-wheelhouse/
strategy:
matrix:
PYTHON:
Expand All @@ -126,27 +90,22 @@ jobs:
name: "Python ${{ matrix.PYTHON.VERSION }} for ABI ${{ matrix.PYTHON.ABI_VERSION }} on macOS"
runs-on: macOS-latest
steps:
-
uses: actions/checkout@v2
-
env:
- uses: actions/checkout@v2
- env:
PYTHON_DOWNLOAD_URL: "${{ matrix.PYTHON.DOWNLOAD_URL }}"
name: "Install Python."
run: |
curl "$PYTHON_DOWNLOAD_URL" -o python.pkg
sudo installer -pkg python.pkg -target /
${{ matrix.PYTHON.BIN_PATH }} -m pip install -U virtualenv
${{ matrix.PYTHON.BIN_PATH }} -m virtualenv venv
-
name: "Install Python dependencies for build process."
- name: "Install Python dependencies for build process."
run: "venv/bin/pip install -U pip setuptools wheel build"
-
name: "Download MCl source tree archive and extract it."
- name: "Download MCl source tree archive and extract it."
run: |
wget https://github.com/herumi/mcl/archive/refs/tags/v1.61.tar.gz
tar -xvzf *.tar.gz
-
env:
- env:
PYTHON_VERSION: "${{ matrix.PYTHON.ABI_VERSION }}"
name: "Build wheel file."
run: |
Expand All @@ -168,81 +127,48 @@ jobs:
otool -L mclbn256/lib/libmcl.dylib # dependency has only standard system dependencies
otool -L mclbn256/libmclbn256.dylib # the BN254 build depends on lib/libmcl.so which may not be in any environment folder
install_name_tool -change lib/libmcl.dylib @loader_path/lib/libmcl.dylib mclbn256/libmclbn256.dylib
# # Build
# venv/bin/python -m build

# mkdir wheelhouse
# mv dist/mclbn*.whl wheelhouse
# -
# name: "Test wheel installation."
# run: |
# ls wheelhouse
# unzip -Zl wheelhouse/*.whl
# # ls -R wheelhouse
# venv/bin/pip install .
# # venv/bin/pip install -f wheelhouse --no-index mclbn256
-
name: "Lint and test module (and compiled MCl shared library files)."
- name: "Lint and test module (and compiled MCl shared library files)."
run: |
venv/bin/python -c "import mclbn256; mclbn256.mclbn256.assert_bilinearity(); mclbn256.mclbn256.assert_serializable(); print('pass')"
# venv/bin/pip install -U pip pylint coverage nose
# venv/bin/python -m pylint mclbn256 # Check against linting rules.
# venv/bin/python mclbn256/mclbn256.py -v # Run doctests.
# venv/bin/python -m nose --cover-erase # Test using nose.
# -
# name: "Upload wheel file."
# run: |
# mkdir mclbn-wheelhouse
# mv wheelhouse/mclbn*.whl mclbn-wheelhouse/
# -
# uses: actions/upload-artifact@v1
# with:
# name: "mclbn-0.3.3-macOS-11-amd-${{ matrix.PYTHON.VERSION }}"
# path: mclbn-wheelhouse/
strategy:
matrix:
PYTHON:
-
ABI_VERSION: "3.6"
- ABI_VERSION: "3.6"
BIN_PATH: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3
DOWNLOAD_URL: "https://www.python.org/ftp/python/3.9.12/python-3.9.12-macos11.pkg"
VERSION: "3.9"
-
ABI_VERSION: "3.6"
- ABI_VERSION: "3.6"
BIN_PATH: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3
DOWNLOAD_URL: "https://www.python.org/ftp/python/3.10.5/python-3.10.5-macos11.pkg"
VERSION: "3.10"
-
ABI_VERSION: "3.6"
- ABI_VERSION: "3.6"
BIN_PATH: /Library/Frameworks/Python.framework/Versions/3.11/bin/python3
DOWNLOAD_URL: "https://www.python.org/ftp/python/3.11.6/python-3.11.6-macos11.pkg"
VERSION: "3.11"
macos-arm:
name: "Python ${{ matrix.PYTHON.VERSION }} for ABI ${{ matrix.PYTHON.ABI_VERSION }} on macOS ARM"
runs-on: [self-hosted, macos, ARM64]
steps:
-
uses: actions/checkout@v2
-
env:
- uses: actions/checkout@v2
- env:
PYTHON_DOWNLOAD_URL: "${{ matrix.PYTHON.DOWNLOAD_URL }}"
name: "Install Python."
run: |
curl "$PYTHON_DOWNLOAD_URL" -o python.pkg
sudo installer -pkg python.pkg -target /
${{ matrix.PYTHON.BIN_PATH }} -m pip install -U virtualenv
${{ matrix.PYTHON.BIN_PATH }} -m virtualenv venv
-
name: "Install Python dependencies for build process."
- name: "Install Python dependencies for build process."
run: "venv/bin/pip install -U pip setuptools wheel build"
-
name: "Download mcl source tree archive and extract it."
- name: "Download mcl source tree archive and extract it."
run: |
wget https://github.com/herumi/mcl/archive/refs/tags/v1.61.tar.gz
tar -xvzf *.tar.gz
-
env:
- env:
PYTHON_VERSION: "${{ matrix.PYTHON.ABI_VERSION }}"
name: "Build wheel file."
run: |
Expand All @@ -264,52 +190,25 @@ jobs:
otool -L mclbn256/lib/libmcl.dylib # dependency has only standard system dependencies
otool -L mclbn256/libmclbn256.dylib # the BN254 build depends on lib/libmcl.so which may not be in any environment folder
install_name_tool -change lib/libmcl.dylib @loader_path/lib/libmcl.dylib mclbn256/libmclbn256.dylib
# # Build
# venv/bin/python -m build

# mkdir wheelhouse
# mv dist/mclbn*.whl wheelhouse
# -
# name: "Test wheel installation."
# run: |
# ls wheelhouse
# unzip -Zl wheelhouse/*.whl
# # ls -R wheelhouse
# venv/bin/pip install -f wheelhouse --no-index mclbn256
-
name: "Lint and test module (and compiled MCl shared library files)."
- name: "Lint and test module (and compiled MCl shared library files)."
run: |
venv/bin/python -c "import mclbn256; mclbn256.mclbn256.assert_bilinearity(); mclbn256.mclbn256.assert_serializable(); print('pass')"
# venv/bin/pip install -U pip pylint coverage nose
# venv/bin/python -m pylint mclbn256 # Check against linting rules.
# venv/bin/python mclbn256/mclbn256.py -v # Run doctests.
#venv/bin/python -m nose --cover-erase # Test using nose. # mclbn256 0.2.0 has succeeded before but but errored at end [due to nose in 3.10 bug](https://github.com/nose-devs/nose/issues/1099)
# -
# name: "Upload wheel file."
# run: |
# mkdir mclbn-wheelhouse
# mv wheelhouse/mclbn*.whl mclbn-wheelhouse/
# -
# uses: actions/upload-artifact@v1
# with:
# name: "mclbn-0.3.3-macOS-arm-${{ matrix.PYTHON.VERSION }}"
# path: mclbn-wheelhouse/
strategy:
matrix:
PYTHON:
-
ABI_VERSION: "3.6"
- ABI_VERSION: "3.6"
BIN_PATH: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3
DOWNLOAD_URL: "https://www.python.org/ftp/python/3.9.12/python-3.9.12-macos11.pkg"
VERSION: "3.9"
-
ABI_VERSION: "3.6"
- ABI_VERSION: "3.6"
BIN_PATH: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3
DOWNLOAD_URL: "https://www.python.org/ftp/python/3.10.5/python-3.10.5-macos11.pkg"
VERSION: "3.10"
-
ABI_VERSION: "3.6"
- ABI_VERSION: "3.6"
BIN_PATH: /Library/Frameworks/Python.framework/Versions/3.11/bin/python3
DOWNLOAD_URL: "https://www.python.org/ftp/python/3.11.6/python-3.11.6-macos11.pkg"
VERSION: "3.11"
Expand Down Expand Up @@ -368,16 +267,6 @@ jobs:
# echo
ls mclbn256/
cp mcl-*/bin/mclbn256.dll mclbn256/libmclbn256.dll
# mkdir wheelhouse
# # call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -no_logo -arch=${{ matrix.WINDOWS.VS_ARCH }}
# python setup.py bdist_wheel --py-limited-api=${{ matrix.PYTHON.ABI_VERSION }}
# # cp build/lib*/mclbn256/_MCL.pyd mclbn256
# ls dist
# mv dist/mclbn256*.whl wheelhouse
# ls wheelhouse
# shell: cmd
# - name: Test wheel installation.
# run: pip install -f wheelhouse mclbn256 --no-index
- name: Lint and test module (and compiled MCl shared library file).
run: |
# python -c "import mclbn256; mclbn256.mclbn256.assert_bilinearity(); mclbn256.mclbn256.assert_serializable(); print('pass')"
Expand Down

0 comments on commit b6e5ac2

Please sign in to comment.