Place azure actions in venv - rename Mojave DMG, add npm fix to all (#241)

* Build in venv on azure
* Add npm audit fix, add venv to most steps on all runners
* Clean azure action, add npm fix to install.sh
* Rename azure pipeline Mojave DMG, prettify
This commit is contained in:
Gene Hoffman 2020-05-23 15:47:01 -07:00 committed by wjblanke
parent 43554fa21e
commit caa71e83ce
5 changed files with 28 additions and 6 deletions

View File

@ -43,9 +43,11 @@ jobs:
run: |
. ./activate
sh install-timelord.sh
./vdf_bench square_asm 400000
- name: Install developer requirements
run: |
. ./activate
venv/bin/python -m pip install -r requirements-dev.txt
- name: Lint source with flake8
@ -59,11 +61,13 @@ jobs:
- name: Build MacOS DMG in Catalina
if: startsWith(matrix.os, 'mac')
run: |
. ./activate
cd build_scripts
sh build_macos.sh
- name: Test blockchain code with pytest
run: |
. ./activate
./venv/bin/py.test tests -s -v
- name: Upload MacOS artifacts

View File

@ -18,13 +18,13 @@ jobs:
with:
python-version: "3.7"
- name: Run build_windows.ps1
- name: Build Windows installer with build_scripts\build_windows.ps1
working-directory: ${{ github.workspace }}\build_scripts
run: |
git config --global core.longpaths true
./build_windows.ps1
- name: Upload Windows exe's
- name: Upload Windows exe's to artifacts
uses: actions/upload-artifact@v1
with:
name: Windows-Exe

View File

@ -14,7 +14,7 @@ pool:
vmImage: "macOS-10.14"
strategy:
matrix:
Python37:
Moajave DMG:
python.version: "3.7"
# Python38:
# python.version: '3.8' # Disabled 3.8 because artifact names conflict
@ -29,6 +29,12 @@ steps:
# since we're installing miniupnpc & setproctitle below,
# only cbor2 will end up in wheels/
- script: |
python -m venv venv
ln -s venv/bin/activate .
. ./activate
echo "which python, pip after activate"
which python
which pip
python -m pip install --upgrade pip
pip install wheel pep517
node -v
@ -38,41 +44,52 @@ steps:
pip install -i https://download.chia.net/simple/ miniupnpc==2.1 setproctitle==1.1.10 cbor2==5.1.0
cd ./electron-react
npm install
npm audit fix
displayName: "Install dependencies"
- script: |
. ./activate
pip wheel --use-pep517 --only-binary cbor2 --extra-index-url https://download.chia.net/simple/ --wheel-dir=wheels .
displayName: "Build wheels"
- script: |
. ./activate
cd ./electron-react
npm install
displayName: "Build Electron UI"
# Using wheels and release style install so no sh install.sh
- script: |
. ./activate
pip install .
displayName: "Install wheels"
# install-timelord.sh usually wants venv, but this clean runner is the "venv"
- script: |
. ./activate
echo "which python"
which python
brew install boost
sh install-timelord.sh
./vdf_bench square_asm 400000
displayName: "Install timelord"
- script: |
. ./activate
python -m pip install -r requirements-dev.txt
displayName: "Install dev dependencies"
- script: |
. ./activate
pip install pytest pytest-azurepipelines
py.test tests -s -v
displayName: "pytest"
- script: |
. ./activate
cd build_scripts
sh build_macos.sh
displayName: "Build DMG"
displayName: "Build DMG with build_scripts/build_macos.sh"
- task: PublishPipelineArtifact@1
inputs:

View File

@ -64,13 +64,13 @@ else
# User needs to provide required packages
echo venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION"
venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION"
link_vdf_bench "$PYTHON_VERSION"
symlink_vdf_bench "$PYTHON_VERSION"
elif [ -e venv/bin/python ]; then
echo "installing chiavdf from source"
# User needs to provide required packages
echo venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION"
venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION"
link_vdf_bench "$PYTHON_VERSION"
symlink_vdf_bench "$PYTHON_VERSION"
else
echo "no venv created yet, please run install.sh"
fi

View File

@ -70,6 +70,7 @@ pip install -e .
cd ./electron-react
npm install
npm audit fix
echo ""
echo "Chia blockchain install.sh complete."