Skip to content

Use earlier macOS for earlier Python versions #823

Use earlier macOS for earlier Python versions

Use earlier macOS for earlier Python versions #823

name: Tests
on:
- pull_request
- workflow_dispatch
env:
# Temporary workaround prior to release of TraitsUI 8.0
# xref: enthought/traits#1742
ETS_QT4_IMPORTS: 1
jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
# Python 3.8 and 3.9 are no longer available on macos-latest, so
# use an earlier version.
# xref: https://github.com/actions/setup-python/issues/850
exclude:
- python-version: "3.8"
os: "macos-latest"
- python-version: "3.9"
os: "macos-latest"
include:
- python-version: "3.8"
os: "macos-13"
- python-version: "3.9"
os: "macos-13"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Linux packages for Qt 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: matrix.os == 'ubuntu-latest'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install test dependencies and local package
run: |
python -m pip install -v .[test]
- 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'