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: Move CI to Github Actions #208

Merged
merged 11 commits into from
Mar 23, 2021
Merged
67 changes: 0 additions & 67 deletions .circleci/config.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .circleci/install.sh

This file was deleted.

17 changes: 0 additions & 17 deletions .circleci/test-pyqt4.sh

This file was deleted.

28 changes: 0 additions & 28 deletions .circleci/test-pyqt5.sh

This file was deleted.

17 changes: 0 additions & 17 deletions .circleci/test-pyside.sh

This file was deleted.

18 changes: 0 additions & 18 deletions .circleci/test-pyside2.sh

This file was deleted.

109 changes: 109 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Tests

on:
# This avoids having duplicate builds for a pull request
push:
branches:
- master
pull_request:
branches:
- master

jobs:
linux:
name: Linux Py${{ matrix.PYTHON_VERSION }} conda=${{ matrix.USE_CONDA }}
runs-on: ubuntu-latest
env:
CI: True
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
USE_CONDA: ${{ matrix.USE_CONDA }}
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['2.7', '3.6', '3.8']
USE_CONDA: ['Yes', 'No']
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Install System Packages
run: |
sudo apt update
sudo apt install libpulse-dev
sudo apt install libegl1-mesa
- name: Install Conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ''
auto-update-conda: true
auto-activate-base: false
- name: Test PyQt5
shell: bash -l {0}
run: |
eval "$(conda shell.bash hook)"
xvfb-run --auto-servernum bash -l ./.github/workflows/test-pyqt5.sh
- name: Test PySide2
shell: bash -l {0}
run: xvfb-run --auto-servernum bash -l ./.github/workflows/test-pyside2.sh
- name: Upload coverage
if: matrix.PYTHON_VERSION == '3.8'
shell: bash -l {0}
run: bash -l ./.github/workflows/coverage.sh

macos:
name: Mac Py${{ matrix.PYTHON_VERSION }} conda=${{ matrix.USE_CONDA }}
runs-on: macos-latest
env:
CI: True
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
USE_CONDA: ${{ matrix.USE_CONDA }}
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['2.7', '3.6', '3.8']
USE_CONDA: ['Yes', 'No']
exclude:
- PYTHON_VERSION: '2.7'
USE_CONDA: 'Yes'
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Install Conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ''
auto-update-conda: true
auto-activate-base: false
- name: Test PyQt5
shell: bash -l {0}
run: bash -l ./.github/workflows/test-pyqt5.sh
- name: Test PySide2
shell: bash -l {0}
run: bash -l ./.github/workflows/test-pyside2.sh

windows:
name: Windows Py${{ matrix.PYTHON_VERSION }} conda=${{ matrix.USE_CONDA }}
runs-on: windows-latest
env:
CI: True
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
USE_CONDA: ${{ matrix.USE_CONDA }}
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['2.7', '3.6', '3.8']
USE_CONDA: ['Yes', 'No']
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Install Conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ''
auto-update-conda: true
auto-activate-base: true
- name: Test PyQt5
shell: bash -l {0}
run: bash -l ./.github/workflows/test-pyqt5.sh
- name: Test PySide2
shell: bash -l {0}
run: bash -l ./.github/workflows/test-pyside2.sh
7 changes: 4 additions & 3 deletions .circleci/coverage.sh → .github/workflows/coverage.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash

export COVERALLS_REPO_TOKEN="xh75EzxFFMoTEyNPo3wXxXv8OVkul3eE5"
export PATH="$HOME/miniconda/bin:$PATH"
source activate test
eval "$(conda shell.bash hook)"
conda deactivate
conda activate test-pyqt5

export COVERALLS_REPO_TOKEN="xh75EzxFFMoTEyNPo3wXxXv8OVkul3eE5"
coveralls

# Don't fail at this step
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/test-pyqt5.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash -ex

# Create conda environment for this test
conda create -n test-pyqt5
conda activate test-pyqt5

# Select build with QtMultimedia
if [ "$(uname)" == "Darwin" ]; then

if [ "$PYTHON_VERSION" = "2.7" ]; then
export QT_VER=5.9
elif [ "$PYTHON_VERSION" = "3.6" ]; then
export QT_VER=5.12
else
export QT_VER=5.*
fi

elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then

if [ "$PYTHON_VERSION" = "2.7" ]; then
export QT_VER=5.9
elif [ "$PYTHON_VERSION" = "3.6" ]; then
export QT_VER=5.12
else
export QT_VER=5.*
fi

else

if [ "$PYTHON_VERSION" = "2.7" ]; then
exit 0
elif [ "$PYTHON_VERSION" = "3.6" ]; then
export QT_VER=5.9
else
export QT_VER=5.*
fi

fi

if [ "$USE_CONDA" = "Yes" ]; then
conda install coveralls mock pytest pytest-cov python="$PYTHON_VERSION" -c conda-forge -q
conda install -q qt=$QT_VER pyqt=$QT_VER -c conda-forge -q
else
if [ "$PYTHON_VERSION" = "2.7" ]; then
# There are no pyqt5 wheels for Python 2
exit 0
else
# We are getting segfaults in 5.10
conda install coveralls mock pytest pytest-cov python="$PYTHON_VERSION" -c anaconda -q
pip install -q pyqt5 PyQtWebEngine
fi
fi

# Install package
python -m pip install -e .

# Run tests
python qtpy/tests/runtests.py
23 changes: 23 additions & 0 deletions .github/workflows/test-pyside2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash -ex

# Create conda environment for this test
conda create -n test-pyside2
conda activate test-pyside2

if [ "$USE_CONDA" = "Yes" ]; then
# There are no conda packages for PySide2
exit 0
elif [ "$PYTHON_VERSION" != "3.6" ] && [ "$RUNNER_OS" = "Windows" ]; then
# There is no wheel for PySide 5.12 on Windows and Python 2.7 or 3.8
exit 0
else
# Simple solution to avoid failures with the Qt3D modules
conda install coveralls mock pytest pytest-cov python="$PYTHON_VERSION" -c conda-forge -q
pip install -q pyside2==5.12
fi

# Install package
python -m pip install -e .

# Run tests
python qtpy/tests/runtests.py
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ toread.md
.chache
.idea/

# Macos
*.DS_Store

# End of File
Loading