Skip to content

Commit

Permalink
Place azure actions in venv - rename Mojave DMG, add npm fix to all (C…
Browse files Browse the repository at this point in the history
…hia-Network#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
  • Loading branch information
hoffmang9 authored and wjblanke committed Jun 1, 2020
1 parent 43554fa commit caa71e8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-ubuntu-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 19 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions install-timelord.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pip install -e .

cd ./electron-react
npm install
npm audit fix

echo ""
echo "Chia blockchain install.sh complete."
Expand Down

0 comments on commit caa71e8

Please sign in to comment.