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

PR: Make CI jobs much faster & less flaky w/Mamba, 1-pass solve & other tweaks #425

Merged
merged 3 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
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
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ jobs:
auto-update-conda: true
channels: conda-forge
channel-priority: strict
miniforge-variant: Mambaforge
use-mamba: true
- name: Print Conda info
shell: bash -l {0}
run: |
conda info
conda list
mamba info
mamba list
- name: Test PyQt5
if: (! matrix.skip-pyqt5)
run: ./.github/workflows/test.sh pyqt5
Expand All @@ -121,7 +123,7 @@ jobs:
if: always() && (! (matrix.skip-pyside6))
run: ./.github/workflows/test.sh pyside6
- name: Upload coverage data to coveralls.io
shell: bash
shell: bash -e {0}
env:
COVERALLS_FLAG_NAME: ${{ matrix.os }} Python ${{ matrix.python-version }} conda=${{ matrix.use-conda }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/test.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#!/bin/bash -ex

# Activate conda properly
eval "$(conda shell.bash hook)"

# Remove any existing env
conda remove -q -n test-env --all || true

# Create and activate conda environment for this test
# Create and activate mamba environment for this test
BINDING=$(echo "$1" | tr '[:lower:]' '[:upper:]')
QT_VERSION_VAR=${BINDING}_QT_VERSION

Expand All @@ -16,22 +12,26 @@ if [ "${!QT_VERSION_VAR:0:3}" = "5.9" ]; then
PYTEST_VERSION=">=6,!=7.0.0,!=7.0.1,<7.2.0"
fi

conda create -q -n test-env python=${PYTHON_VERSION} pytest${PYTEST_VERSION:-">=6,!=7.0.0,!=7.0.1"} "pytest-cov>=3.0.0" pytest-qt${PYTESTQT_VERSION:-}
conda activate test-env

if [ "$USE_CONDA" = "Yes" ]; then

if [ "${1}" = "pyqt5" ]; then
conda install -q qt=${PYQT5_QT_VERSION} pyqt=${PYQT5_VERSION}
QT_SPECS="qt=${PYQT5_QT_VERSION} pyqt=${PYQT5_VERSION}"
elif [ "${1}" = "pyside2" ]; then
conda install -q qt=${PYSIDE2_QT_VERSION} pyside2=${PYSIDE2_VERSION}
QT_SPECS="qt=${PYSIDE2_QT_VERSION} pyside2=${PYSIDE2_VERSION}"
elif [ "${1}" = "pyside6" ]; then
conda install -q qt6-main=${PYSIDE6_QT_VERSION} pyside6=${PYSIDE6_VERSION}
QT_SPECS="qt6-main=${PYSIDE6_QT_VERSION} pyside6=${PYSIDE6_VERSION}"
else
exit 1
fi

else
fi

mamba create -y -n test-env-${BINDING} python=${PYTHON_VERSION} pytest${PYTEST_VERSION:->=6,!=7.0.0,!=7.0.1} pytest-cov>=3.0.0 pytest-qt${PYTESTQT_VERSION:-} ${QT_SPECS:-}

conda activate test-env-${BINDING}

if [ "$USE_CONDA" = "No" ]; then

if [ "${1}" = "pyqt5" ]; then
pip install pyqt5==${PYQT5_VERSION}.* PyQtWebEngine==${PYQT5_VERSION}.* QScintilla==${QSCINTILLA_VERSION}.*
Expand Down Expand Up @@ -60,7 +60,7 @@ python -bb -X dev -W error -m build
echo dist/*.whl | xargs -I % python -bb -X dev -W error -W "ignore::DeprecationWarning:pip._internal.locations._distutils" -W "ignore::DeprecationWarning:distutils.command.install" -m pip install --upgrade %

# Print environment information
conda list
mamba list

# Run tests
mkdir -p temp_test_dir
Expand Down