2019-09-22 17:09:27 +03:00
|
|
|
name: Test
|
|
|
|
|
2023-03-04 16:44:56 +03:00
|
|
|
on:
|
|
|
|
push:
|
2023-10-15 20:46:25 +03:00
|
|
|
branches:
|
|
|
|
- "**"
|
2023-03-04 16:44:56 +03:00
|
|
|
paths-ignore:
|
|
|
|
- ".github/workflows/docs.yml"
|
2023-10-02 11:01:23 +03:00
|
|
|
- ".github/workflows/wheels*"
|
|
|
|
- ".gitmodules"
|
2023-03-04 16:44:56 +03:00
|
|
|
- "docs/**"
|
2023-10-02 11:01:23 +03:00
|
|
|
- "wheels/**"
|
2023-03-04 16:44:56 +03:00
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- ".github/workflows/docs.yml"
|
2023-10-02 11:01:23 +03:00
|
|
|
- ".github/workflows/wheels*"
|
|
|
|
- ".gitmodules"
|
2023-03-04 16:44:56 +03:00
|
|
|
- "docs/**"
|
2023-10-02 11:01:23 +03:00
|
|
|
- "wheels/**"
|
2023-03-04 16:44:56 +03:00
|
|
|
workflow_dispatch:
|
2019-09-22 17:09:27 +03:00
|
|
|
|
2022-07-04 04:19:58 +03:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2022-11-09 10:42:46 +03:00
|
|
|
concurrency:
|
2022-09-26 15:16:33 +03:00
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2024-01-20 20:08:51 +03:00
|
|
|
env:
|
2024-02-20 22:42:39 +03:00
|
|
|
COVERAGE_CORE: sysmon
|
2024-01-20 20:08:51 +03:00
|
|
|
FORCE_COLOR: 1
|
|
|
|
|
2019-09-22 17:09:27 +03:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
strategy:
|
2019-10-12 12:14:49 +03:00
|
|
|
fail-fast: false
|
2019-09-22 17:09:27 +03:00
|
|
|
matrix:
|
2019-09-22 23:09:59 +03:00
|
|
|
os: [
|
2024-01-30 19:26:20 +03:00
|
|
|
"macos-14",
|
2021-10-18 11:29:01 +03:00
|
|
|
"ubuntu-latest",
|
2019-09-22 23:09:59 +03:00
|
|
|
]
|
2019-09-22 17:09:27 +03:00
|
|
|
python-version: [
|
2023-06-16 17:25:59 +03:00
|
|
|
"pypy3.10",
|
2022-12-06 21:55:34 +03:00
|
|
|
"pypy3.9",
|
2023-11-08 14:58:58 +03:00
|
|
|
"3.13",
|
2023-10-03 22:58:02 +03:00
|
|
|
"3.12",
|
2022-10-25 15:34:31 +03:00
|
|
|
"3.11",
|
2021-10-05 11:54:12 +03:00
|
|
|
"3.10",
|
2020-10-06 17:28:42 +03:00
|
|
|
"3.9",
|
2019-11-04 23:55:50 +03:00
|
|
|
"3.8",
|
2019-09-22 17:09:27 +03:00
|
|
|
]
|
|
|
|
include:
|
2024-01-30 19:26:20 +03:00
|
|
|
- python-version: "3.11"
|
2020-11-03 18:31:59 +03:00
|
|
|
PYTHONOPTIMIZE: 1
|
2021-06-14 15:58:40 +03:00
|
|
|
REVERSE: "--reverse"
|
2024-01-30 19:26:20 +03:00
|
|
|
- python-version: "3.10"
|
2020-11-03 18:31:59 +03:00
|
|
|
PYTHONOPTIMIZE: 2
|
2024-01-30 19:26:20 +03:00
|
|
|
# M1 only available for 3.10+
|
|
|
|
- os: "macos-latest"
|
|
|
|
python-version: "3.9"
|
|
|
|
- os: "macos-latest"
|
|
|
|
python-version: "3.8"
|
|
|
|
exclude:
|
|
|
|
- os: "macos-14"
|
|
|
|
python-version: "3.9"
|
|
|
|
- os: "macos-14"
|
|
|
|
python-version: "3.8"
|
2020-01-24 15:24:31 +03:00
|
|
|
|
2019-09-22 23:09:59 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
|
2019-09-22 17:09:27 +03:00
|
|
|
|
|
|
|
steps:
|
2023-09-05 00:04:29 +03:00
|
|
|
- uses: actions/checkout@v4
|
2019-09-22 17:09:27 +03:00
|
|
|
|
2020-06-30 22:26:41 +03:00
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2023-12-07 18:07:52 +03:00
|
|
|
uses: actions/setup-python@v5
|
2019-11-04 10:06:09 +03:00
|
|
|
with:
|
2020-06-30 22:26:41 +03:00
|
|
|
python-version: ${{ matrix.python-version }}
|
2023-11-08 14:58:58 +03:00
|
|
|
allow-prereleases: true
|
2021-11-18 14:42:41 +03:00
|
|
|
cache: pip
|
2024-01-20 20:08:51 +03:00
|
|
|
cache-dependency-path: |
|
|
|
|
".ci/*.sh"
|
|
|
|
"pyproject.toml"
|
2019-11-04 10:06:09 +03:00
|
|
|
|
2019-12-09 23:35:31 +03:00
|
|
|
- name: Build system information
|
2021-01-06 14:42:31 +03:00
|
|
|
run: python3 .github/workflows/system-info.py
|
2019-12-09 23:35:31 +03:00
|
|
|
|
2024-01-21 02:15:59 +03:00
|
|
|
- name: Cache libimagequant
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
uses: actions/cache@v4
|
|
|
|
id: cache-libimagequant
|
|
|
|
with:
|
|
|
|
path: ~/cache-libimagequant
|
|
|
|
key: ${{ runner.os }}-libimagequant-${{ hashFiles('depends/install_imagequant.sh') }}
|
|
|
|
|
2019-09-22 23:09:59 +03:00
|
|
|
- name: Install Linux dependencies
|
2019-10-09 15:10:27 +03:00
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
2019-09-22 17:09:27 +03:00
|
|
|
run: |
|
2020-01-08 16:41:48 +03:00
|
|
|
.ci/install.sh
|
2020-08-13 12:39:08 +03:00
|
|
|
env:
|
|
|
|
GHA_PYTHON_VERSION: ${{ matrix.python-version }}
|
2024-01-21 02:15:59 +03:00
|
|
|
GHA_LIBIMAGEQUANT_CACHE_HIT: ${{ steps.cache-libimagequant.outputs.cache-hit }}
|
2019-09-22 17:09:27 +03:00
|
|
|
|
2019-09-22 23:09:59 +03:00
|
|
|
- name: Install macOS dependencies
|
2019-10-09 15:10:27 +03:00
|
|
|
if: startsWith(matrix.os, 'macOS')
|
2019-09-22 23:09:59 +03:00
|
|
|
run: |
|
|
|
|
.github/workflows/macos-install.sh
|
2022-04-28 21:28:46 +03:00
|
|
|
env:
|
|
|
|
GHA_PYTHON_VERSION: ${{ matrix.python-version }}
|
2019-09-22 23:09:59 +03:00
|
|
|
|
2023-11-28 02:50:42 +03:00
|
|
|
- name: Register gcc problem matcher
|
|
|
|
if: "matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'"
|
|
|
|
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
|
|
|
|
|
2019-09-23 17:02:09 +03:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2020-01-08 16:41:48 +03:00
|
|
|
.ci/build.sh
|
2019-09-23 17:02:09 +03:00
|
|
|
|
2019-09-22 17:09:27 +03:00
|
|
|
- name: Test
|
2020-11-04 16:58:33 +03:00
|
|
|
run: |
|
2021-06-14 15:58:40 +03:00
|
|
|
if [ $REVERSE ]; then
|
|
|
|
python3 -m pip install pytest-reverse
|
|
|
|
fi
|
2020-11-04 16:58:33 +03:00
|
|
|
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
|
2023-04-18 03:27:36 +03:00
|
|
|
xvfb-run -s '-screen 0 1024x768x24' sway&
|
2023-04-17 11:44:43 +03:00
|
|
|
export WAYLAND_DISPLAY=wayland-1
|
|
|
|
.ci/test.sh
|
2020-11-04 16:58:33 +03:00
|
|
|
else
|
|
|
|
.ci/test.sh
|
|
|
|
fi
|
2020-11-03 18:31:59 +03:00
|
|
|
env:
|
|
|
|
PYTHONOPTIMIZE: ${{ matrix.PYTHONOPTIMIZE }}
|
2021-06-14 15:58:40 +03:00
|
|
|
REVERSE: ${{ matrix.REVERSE }}
|
2019-09-22 17:09:27 +03:00
|
|
|
|
2020-01-25 05:30:21 +03:00
|
|
|
- name: Prepare to upload errors
|
|
|
|
if: failure()
|
|
|
|
run: |
|
|
|
|
mkdir -p Tests/errors
|
|
|
|
|
2019-10-12 13:59:03 +03:00
|
|
|
- name: Upload errors
|
2023-12-15 06:45:41 +03:00
|
|
|
uses: actions/upload-artifact@v4
|
2019-10-12 13:59:03 +03:00
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: errors
|
|
|
|
path: Tests/errors
|
|
|
|
|
2019-09-22 17:09:27 +03:00
|
|
|
- name: After success
|
|
|
|
run: |
|
2020-01-08 16:41:48 +03:00
|
|
|
.ci/after_success.sh
|
2019-11-20 15:00:59 +03:00
|
|
|
|
|
|
|
- name: Upload coverage
|
2024-02-03 15:43:04 +03:00
|
|
|
uses: codecov/codecov-action@v3.1.5
|
2022-08-27 05:17:40 +03:00
|
|
|
with:
|
2024-01-30 19:26:20 +03:00
|
|
|
flags: ${{ matrix.os == 'ubuntu-latest' && 'GHA_Ubuntu' || 'GHA_macOS' }}
|
2022-08-27 05:17:40 +03:00
|
|
|
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
|
2023-02-12 02:16:13 +03:00
|
|
|
gcov: true
|
2020-09-23 09:56:17 +03:00
|
|
|
|
|
|
|
success:
|
2022-07-04 04:19:58 +03:00
|
|
|
permissions:
|
|
|
|
contents: none
|
2020-09-23 09:56:17 +03:00
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Test Successful
|
|
|
|
steps:
|
|
|
|
- name: Success
|
|
|
|
run: echo Test Successful
|