1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
name: Linux tests
on:
push:
branches:
- master
- 6.*
paths:
- '.github/scripts/install.sh'
- '.github/scripts/remove_check_qtwebengine.sh'
- '.github/scripts/run_tests.sh'
- '.github/workflows/test-linux.yml'
- 'requirements/*.yml'
- 'MANIFEST.in'
- '**.bat'
- '**.py'
- '**.sh'
- '!installers-conda/**'
pull_request:
branches:
- master
- 6.*
paths:
- '.github/scripts/install.sh'
- '.github/scripts/remove_check_qtwebengine.sh'
- '.github/scripts/run_tests.sh'
- '.github/workflows/test-linux.yml'
- 'requirements/*.yml'
- 'MANIFEST.in'
- '**.bat'
- '**.py'
- '**.sh'
- '!installers-conda/**'
workflow_call:
workflow_dispatch:
inputs:
ssh:
# github_cli: gh workflow run test-linux.yml --ref <branch> -f ssh=true
description: 'Enable ssh debugging'
required: false
default: false
type: boolean
concurrency:
group: test-linux-${{ github.ref }}
cancel-in-progress: true
env:
ENABLE_SSH: ${{ github.event_name == 'workflow_dispatch' && inputs.ssh }}
jobs:
build:
# Use this to disable the workflow
# if: false
name: Linux - Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
runs-on: ubuntu-22.04
env:
CI: 'true'
QTCONSOLE_TESTING: 'true'
CODECOV_TOKEN: "56731c25-9b1f-4340-8b58-35739bfbc52d"
OS: 'linux'
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
RUN_SLOW: ${{ matrix.TEST_TYPE == 'slow' }}
USE_CONDA: ${{ matrix.INSTALL_TYPE == 'conda' }}
USE_GDB: 'false'
strategy:
fail-fast: false
matrix:
INSTALL_TYPE: ['pip', 'conda']
PYTHON_VERSION: ['3.9', '3.12']
TEST_TYPE: ['fast', 'slow']
exclude:
# Only test Python 3.9 with pip to save CI time
- INSTALL_TYPE: 'conda'
PYTHON_VERSION: '3.9'
timeout-minutes: 90
steps:
- name: Setup Remote SSH Connection
if: env.ENABLE_SSH == 'true'
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60
with:
detached: true
- name: Checkout Pull Requests
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout Push
if: github.event_name != 'pull_request'
uses: actions/checkout@v4
- name: Fetch branches
run: git fetch --prune --unshallow
- name: Install dependencies
shell: bash
run: |
sudo apt-get update --fix-missing
sudo apt-get install -qq pyqt5-dev-tools libxcb-xinerama0 xterm --fix-missing
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('setup.py') }}
- name: Create conda test environment
if: env.USE_CONDA == 'true'
uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: '1.5.10-0'
environment-file: requirements/main.yml
environment-name: test
cache-downloads: true
create-args: python=${{ matrix.PYTHON_VERSION }}
- name: Create pip test environment
if: env.USE_CONDA != 'true'
uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: '1.5.10-0'
environment-name: test
cache-downloads: true
create-args: python=${{ matrix.PYTHON_VERSION }}
condarc: |
channels:
- conda-forge
- name: Install additional dependencies
shell: bash -l {0}
run: bash -l .github/scripts/install.sh
- name: Show conda test environment
if: env.USE_CONDA == 'true'
shell: bash -l {0}
run: |
micromamba info
micromamba list
- name: Show pip test environment
if: env.USE_CONDA != 'true'
shell: bash -l {0}
run: |
micromamba info
micromamba list
pip list
- name: Run manifest checks
shell: bash -l {0}
run: check-manifest
- name: Run tests with gdb
if: env.USE_GDB == 'true'
shell: bash -l {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: xvfb-run --auto-servernum gdb -return-child-result -batch -ex r -ex py-bt --args python runtests.py -s
- name: Run tests
shell: bash -l {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rm -f pytest_log.txt # Must remove any log file from a previous run
.github/scripts/run_tests.sh -n 0 || \
.github/scripts/run_tests.sh -n 1 || \
.github/scripts/run_tests.sh -n 2 || \
.github/scripts/run_tests.sh -n 3
- name: Coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
verbose: true
# Note: This will remove qtwebengine so make sure it's done last!
- name: Ensure QtWebEngine is optional
run: xvfb-run --auto-servernum .github/scripts/remove_check_qtwebengine.sh
shell: bash -l {0}
if: matrix.INSTALL_TYPE == 'pip' && matrix.TEST_TYPE == 'fast'
|