Skip to content

Make single-file installers #76

Make single-file installers

Make single-file installers #76

Workflow file for this run

name: Make single-file installers
on:
workflow_dispatch:
jobs:
test:
name: Building single file installer on ${{ matrix.cfg.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest]
python-version: ["3.9", "3.10"]
env:
CI_OS: ${{ matrix.os }}
PYVER: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Install conda environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/installer.yaml
create-args: >-
python=${{ matrix.python-version }}
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
- name: Environment Information
shell: bash -l {0}
run: |
conda info
conda list
- name: Prepare and run the constructor
shell: bash -l {0}
run: |
#cd ..
# Find the tag of the last release (excluding RCs)
# TODO: Make this a variable that can be passed through from trigger and/or allow RC
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openff-toolkit.git | cut -f2 | grep -E "([0-9]+)\.([0-9]+)\.([0-9]+)$" | sort --version-sort | tail -1 | sed 's/refs\/tags\///')
echo $LATEST_TAG
git clone https://github.com/openforcefield/toolkit-installer-constructor
cd toolkit-installer-constructor
python ../devtools/scripts/build_cookiecutter_json.py $LATEST_TAG $PYVER $CI_OS
cp new_cookiecutter.json cookiecutter/cookiecutter.json
cat new_cookiecutter.json
python run.py
pwd
ls
ls build
- name: Upload installer as artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}_py${{ matrix.python-version }}.sh
path: toolkit-installer-constructor/build/openff-toolkit*/openff-toolkit*.sh
- name: Install from installer
shell: bash -l {0}
run: |
#cd ..
pwd
ls
ls toolkit-installer-constructor
ls toolkit-installer-constructor/build
ls toolkit-installer-constructor/build/openff-toolkit-*/
mkdir scratch
cd scratch
echo $HOME/constructor_install/ | bash ../toolkit-installer-constructor/build/openff-toolkit-*/openff-toolkit-*.sh
conda activate $HOME/constructor_install/
conda info
conda list
export FOUND_VER=$(python -c "import openff.toolkit; print(openff.toolkit.__version__)")
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openff-toolkit.git | cut -f2 | grep -v "rc" | tail -1 | sed 's/refs\/tags\///')
echo $LATEST_TAG
echo $FOUND_VER
if [[ $LATEST_TAG != $FOUND_VER ]];
then echo "Version mismatch"
exit 1
fi
PYTEST_ARGS=" -r fE --tb=short"
PYTEST_ARGS+=" --ignore=openff/toolkit/tests/test_links.py"
# This should work if run directly at release time, but a safer approach would be
# to `git checkout` the corresponding tag of the release, see PR #577
pytest $PYTEST_ARGS ../openff/toolkit/tests/