Skip to content
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

remove dead docker run in build step #76

Merged
merged 5 commits into from
Mar 18, 2024
Merged
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
54 changes: 10 additions & 44 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,58 +31,38 @@ jobs:
with:
fetch-depth: 0

- name: Set up rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- uses: actions/setup-python@v4
name: Install Python ${{ matrix.python }}
with:
python-version: ${{ matrix.python }}

- name: Update pip
run: |
python -m pip install --upgrade pip
- uses: chia-network/actions/create-venv@main
id: create-venv

- name: Set up rust
uses: actions-rs/toolchain@v1
- uses: chia-network/actions/activate-venv@main
with:
toolchain: stable
directories: ${{ steps.create-venv.outputs.activate-venv-directories }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install maturin==1.1.0

- name: Build MacOs with maturin on Python ${{ matrix.python }}
if: startsWith(matrix.os, 'macos')
env:
MACOSX_DEPLOYMENT_TARGET: '11.0'
run: |
python -m venv venv
ln -s venv/bin/activate
. ./activate
maturin build -i python --release --strip

- name: Build Linux in manylinux2010 with maturin on Python ${{ matrix.python }}
if: startsWith(matrix.os, 'ubuntu')
run: |
docker run --rm \
-v ${{ github.workspace }}:/ws --workdir=/ws \
ghcr.io/chia-network/build-images/centos-pypa-rust-x86_64 \
bash -exc '\
yum -y install libc6 openssl-devel && \
source $HOME/.cargo/env && \
rustup target add x86_64-unknown-linux-musl && \
rm -rf venv && \
PY_VERSION=${{ matrix.python }}
PY_VERSION=${PY_VERSION/.} && \
echo "Python version with dot removed is $PY_VERSION" && \
if [ "$PY_VERSION" = "37" ]; \
then export SCND_VERSION="${PY_VERSION}m"; \
else export SCND_VERSION="$PY_VERSION"; fi && \
echo "Exporting path /opt/python/cp$PY_VERSION-cp$SCND_VERSION/bin" && \
export PATH=/opt/python/cp$PY_VERSION-cp$SCND_VERSION/bin/:$PATH && \
/opt/python/cp38-cp38/bin/python -m venv venv && \
if [ ! -f "activate" ]; then ln -s venv/bin/activate; fi && \
. ./activate && \
pip install --upgrade pip
'
docker run --rm -v $(pwd):/io ghcr.io/pyo3/maturin:v1.1.0 build --release --strip --manylinux 2014
# Refresh in case any ownerships changed.
mv target target.docker && cp -r target.docker target
Expand All @@ -92,17 +72,13 @@ jobs:
- name: Build Windows with maturin on Python ${{ matrix.python }}
if: startsWith(matrix.os, 'windows')
run: |
python -m venv venv
echo ". .\venv\Scripts\Activate.ps1" > activate.ps1
. ./activate
maturin build -i python --release --strip
# Find and install the newly built wheel
pip install --no-index --find-links target/wheels/ clvm_tools_rs

- name: Install clvm_tools_rs wheel
if: ${{ !startsWith(matrix.os, 'windows') }}
run: |
. ./activate
ls target/wheels/
# this mess puts the name of the `.whl` file into `$WHEEL_PATH`
# remove the dot, use the `glob` lib to grab the file from the directory
Expand All @@ -112,13 +88,11 @@ jobs:

- name: Install other wheels
run: |
. ./activate
python -m pip install pytest
python -m pip install blspy

- name: install clvm & clvm_tools
run: |
. ./activate
git clone https://github.com/Chia-Network/clvm.git --branch=main --single-branch
python -m pip install ./clvm

Expand All @@ -133,7 +107,6 @@ jobs:

- name: Ensure clvm, clvm_rs, clvm_tools_rs are installed
run: |
. ./activate
python -c 'import clvm'
python -c 'import clvm; print(clvm.__file__)'
python -c 'import clvm_rs; print(clvm_rs.__file__)'
Expand All @@ -143,7 +116,6 @@ jobs:
# Test cldb output both run from python and via its command line tool.
- name: "Run step run tests"
run: |
. ./activate
cargo build
# This finds and installs a compatible wheel from the target directory on linux.
# We do it here as a hedge against changes in the python environment that might
Expand All @@ -156,7 +128,6 @@ jobs:

- name: "Test step run with mandelbrot, setting print only"
run: |
. ./activate
python ./resources/tests/lib/steprun.py ./resources/tests/mandelbrot/mandelbrot.clvm.hex resources/tests/mandelbrot/mand_args.txt ./resources/tests/mandelbrot/mandelbrot.sym > mand_output.txt
# git diff invoked this way returns 0 (as /bin/true) if there is no difference or 1 if there is.
git diff --no-index -s --quiet -- mand_output.txt ./resources/tests/mandelbrot/mand_test.txt
Expand All @@ -169,7 +140,6 @@ jobs:
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.8')
run: |
set -x
. ./activate
# Build cmd line tools
PYO3_PYTHON=`which python` cargo build --release

Expand Down Expand Up @@ -200,7 +170,6 @@ jobs:
- name: Verify recompilation of cl21 sources
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.8')
run: |
. ./activate
# We need chia-rs for the following.
pip install chia-rs
# Ensure we're using the sources we have. This is a hedge against
Expand All @@ -217,18 +186,15 @@ jobs:

- name: Install pytest
run: |
. ./activate
pip install pytest pytest-asyncio

- name: Run tests from clvm
run: |
. ./activate
cd clvm
pytest tests

- name: Run tests from clvm_tools
run: |
. ./activate
cd clvm_tools
pytest tests

Expand Down
Loading