Skip to content

Test installation from PyPI #89

Test installation from PyPI

Test installation from PyPI #89

name: Test installation from PyPI
on:
workflow_dispatch:
schedule:
# Run at 03:27 UTC on the 8th and 22nd of every month
- cron: '27 3 8,22 * *'
env:
# Temporary workaround prior to release of Traits 8.0
# xref: enthought/traits#1742
ETS_QT4_IMPORTS: 1
jobs:
test-pypi-sdist:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-architecture: [x86, x64]
exclude:
- os: macos-latest
python-architecture: x86
- os: ubuntu-latest
python-architecture: x86
runs-on: ${{ matrix.os }}
steps:
- name: Install Linux packages for Qt 5 support
run: |
sudo apt-get update
sudo apt-get install libegl1
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install libxcb-cursor0
sudo apt-get install libxcb-icccm4
sudo apt-get install libxcb-image0
sudo apt-get install libxcb-keysyms1
sudo apt-get install libxcb-randr0
sudo apt-get install libxcb-render-util0
sudo apt-get install libxcb-shape0
if: runner.os == 'Linux'
- name: Set up Python ${{ matrix.python-version }} (${{ matrix.python-architecture }})
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
- name: Install test dependencies and Traits from PyPI sdist (no PySide6)
run: |
python -m pip install --no-binary traits Cython numpy Sphinx traits traitsui
if: matrix.python-version == '3.11' || matrix.python-architecture == 'x86'
- name: Install test dependencies and Traits from PyPI sdist (PySide6)
run: |
python -m pip install --no-binary traits Cython numpy PySide6 Sphinx traits traitsui
if: matrix.python-version != '3.11' && matrix.python-architecture != 'x86'
- name: Create clean test directory
run: |
mkdir testdir
- name: Test Traits package (Linux)
run: cd testdir && xvfb-run -a python -m unittest discover -v traits
if: matrix.os == 'ubuntu-latest'
- name: Test Traits package (Windows/macOS)
run: cd testdir && python -m unittest discover -v traits
if: matrix.os != 'ubuntu-latest'
test-pypi-wheel:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-architecture: [x86, x64]
exclude:
- os: macos-latest
python-architecture: x86
- os: ubuntu-latest
python-architecture: x86
runs-on: ${{ matrix.os }}
steps:
- name: Install Linux packages for Qt 5 support
run: |
sudo apt-get update
sudo apt-get install libegl1
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install libxcb-cursor0
sudo apt-get install libxcb-icccm4
sudo apt-get install libxcb-image0
sudo apt-get install libxcb-keysyms1
sudo apt-get install libxcb-randr0
sudo apt-get install libxcb-render-util0
sudo apt-get install libxcb-shape0
if: runner.os == 'Linux'
- name: Set up Python ${{ matrix.python-version }} (${{ matrix.python-architecture }})
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
- name: Install test dependencies and Traits from PyPI wheel (no PySide6)
run: |
python -m pip install --only-binary traits Cython numpy Sphinx traits traitsui
if: matrix.python-version == '3.11' || matrix.python-architecture == 'x86'
- name: Install test dependencies and Traits from PyPI wheel (PySide6)
run: |
python -m pip install --only-binary traits Cython numpy PySide6 Sphinx traits traitsui
if: matrix.python-version != '3.11' && matrix.python-architecture != 'x86'
- name: Create clean test directory
run: |
mkdir testdir
- name: Test Traits package (Linux)
run: cd testdir && xvfb-run -a python -m unittest discover -v traits
if: matrix.os == 'ubuntu-latest'
- name: Test Traits package (Windows/macOS)
run: cd testdir && python -m unittest discover -v traits
if: matrix.os != 'ubuntu-latest'
notify-on-failure:
needs: [test-pypi-sdist, test-pypi-wheel]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify Slack channel on failure
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel_id: ${{ secrets.ETS_SLACK_CHANNEL_ID }}
status: FAILED
color: danger
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ACTION_SECRET }}
notify-on-success:
needs: [test-pypi-sdist, test-pypi-wheel]
if: success()
runs-on: ubuntu-latest
steps:
- name: Notify Slack channel on success
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel_id: ${{ secrets.ETS_BOTS_SLACK_CHANNEL_ID }}
status: SUCCESS
color: good
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ACTION_SECRET }}