Skip to content

Build once, test many #208

Build once, test many

Build once, test many #208

# Taken from clvm_rs' version.
name: Extensive tests
on:
push:
branches:
- main
- dev
tags:
- "**"
pull_request:
branches:
- "**"
jobs:
extensive_tests:
name: Extensive tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: actions/setup-python@v4
name: Install Python 3.11
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install maturin==1.1.0
- name: Build Linux in manylinux2014 with maturin on Python 3.11
run: |
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
# Ensure an empty .cargo-lock file exists.
touch target/release/.cargo-lock
- name: Install clvm_tools_rs wheel
if: ${{ !startsWith(matrix.os, 'windows') }}
run: |
python -m venv venv
ln -s venv/bin/activate
. ./activate
pip install --upgrade pip
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
export WHEEL_PATH=$(echo ${{ matrix.python }} | python -c 'DOTLESS=input().replace(".", ""); import glob; print(" ".join(filter(lambda x: "musl" not in x, glob.glob("target/wheels/clvm_tools_rs-*-cp*-*.whl"))))' )
echo ${WHEEL_PATH}
pip install ${WHEEL_PATH}
- 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
echo "installing clvm_rs via pip"
pip install clvm_rs
echo "installing clvm_tools for clvm tests"
# clvm tools is required to run the tests is clvm
python -m pip install clvm_tools
- name: Run game referee test
run: |
. ./activate
cp support/test-game-referee.sh .
sh test-game-referee.sh resources/tests/game-referee-in-cl23
sh test-game-referee.sh resources/tests/game-referee-in-cl21
sh test-game-referee.sh resources/tests/game-referee-after-cl21