test.yml
98 lines
| 3.6 KiB
| text/x-yaml
|
YamlLexer
Blazej Michalik
|
r26431 | name: Run tests | ||
Matthew Feickert
|
r26840 | on: | ||
push: | ||||
Matthias Bussonnier
|
r27426 | branches: | ||
- main | ||||
- '*.x' | ||||
Matthew Feickert
|
r26840 | pull_request: | ||
# Run weekly on Monday at 1:23 UTC | ||||
schedule: | ||||
- cron: '23 1 * * 1' | ||||
workflow_dispatch: | ||||
Blazej Michalik
|
r26431 | |||
jobs: | ||||
test: | ||||
Matthew Feickert
|
r26841 | runs-on: ${{ matrix.os }} | ||
Blazej Michalik
|
r26431 | strategy: | ||
Matthias Bussonnier
|
r27642 | fail-fast: false | ||
Blazej Michalik
|
r26431 | matrix: | ||
Nikita Kniazev
|
r27125 | os: [ubuntu-latest, windows-latest] | ||
Matthias Bussonnier
|
r28219 | python-version: ["3.9", "3.10", "3.11"] | ||
Nikita Kniazev
|
r27104 | deps: [test_extra] | ||
Matthew Feickert
|
r26841 | # Test all on ubuntu, test ends on macos | ||
include: | ||||
- os: macos-latest | ||||
Matthias Bussonnier
|
r28219 | python-version: "3.9" | ||
Nikita Kniazev
|
r27104 | deps: test_extra | ||
Matthew Feickert
|
r26841 | - os: macos-latest | ||
Matthias Bussonnier
|
r27973 | python-version: "3.11" | ||
Nikita Kniazev
|
r27104 | deps: test_extra | ||
# Tests minimal dependencies set | ||||
- os: ubuntu-latest | ||||
Matthias Bussonnier
|
r27973 | python-version: "3.11" | ||
Nikita Kniazev
|
r27104 | deps: test | ||
Nikita Kniazev
|
r27105 | # Tests latest development Python version | ||
- os: ubuntu-latest | ||||
Matthias Bussonnier
|
r27973 | python-version: "3.12-dev" | ||
Nikita Kniazev
|
r27105 | deps: test | ||
Nikita Kniazev
|
r27235 | # Installing optional dependencies stuff takes ages on PyPy | ||
- os: ubuntu-latest | ||||
Matthias Bussonnier
|
r28219 | python-version: "pypy-3.9" | ||
Nikita Kniazev
|
r27235 | deps: test | ||
- os: windows-latest | ||||
Matthias Bussonnier
|
r28219 | python-version: "pypy-3.9" | ||
Nikita Kniazev
|
r27235 | deps: test | ||
- os: macos-latest | ||||
Matthias Bussonnier
|
r28219 | python-version: "pypy-3.9" | ||
Nikita Kniazev
|
r27235 | deps: test | ||
Blazej Michalik
|
r26431 | |||
steps: | ||||
Christian Clauss
|
r27722 | - uses: actions/checkout@v3 | ||
Blazej Michalik
|
r26431 | - name: Set up Python ${{ matrix.python-version }} | ||
Christian Clauss
|
r27722 | uses: actions/setup-python@v4 | ||
Blazej Michalik
|
r26431 | with: | ||
python-version: ${{ matrix.python-version }} | ||||
Matthias Bussonnier
|
r27270 | cache: pip | ||
Matthias Bussonnier
|
r28177 | cache-dependency-path: | | ||
setup.cfg | ||||
Nikita Kniazev
|
r27085 | - name: Install latex | ||
Nikita Kniazev
|
r27104 | if: runner.os == 'Linux' && matrix.deps == 'test_extra' | ||
Matthias Bussonnier
|
r27416 | run: echo "disable latex for now, issues in mirros" #sudo apt-get -yq -o Acquire::Retries=3 --no-install-suggests --no-install-recommends install texlive dvipng | ||
Matthias Bussonnier
|
r28173 | - name: Install and update Python dependencies (binary only) | ||
if: ${{ ! contains( matrix.python-version, 'dev' ) }} | ||||
Blazej Michalik
|
r26431 | run: | | ||
Matthias Bussonnier
|
r28172 | python -m pip install --only-binary ':all:' --upgrade pip setuptools wheel build | ||
python -m pip install --only-binary ':all:' --no-binary curio --upgrade -e .[${{ matrix.deps }}] | ||||
python -m pip install --only-binary ':all:' --upgrade check-manifest pytest-cov pytest-json-report | ||||
Matthias Bussonnier
|
r28173 | - name: Install and update Python dependencies (dev?) | ||
if: ${{ contains( matrix.python-version, 'dev' ) }} | ||||
run: | | ||||
python -m pip install --pre --upgrade pip setuptools wheel build | ||||
Matthias Bussonnier
|
r28307 | python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --no-binary curio --upgrade -e .[${{ matrix.deps }}] | ||
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --upgrade check-manifest pytest-cov pytest-json-report | ||||
Matthias Bussonnier
|
r27269 | - name: Try building with Python build | ||
if: runner.os != 'Windows' # setup.py does not support sdist on Windows | ||||
run: | | ||||
python -m build | ||||
shasum -a 256 dist/* | ||||
Thomas Kluyver
|
r26440 | - name: Check manifest | ||
Nikita Kniazev
|
r27125 | if: runner.os != 'Windows' # setup.py does not support sdist on Windows | ||
Thomas Kluyver
|
r26440 | run: check-manifest | ||
Blazej Michalik
|
r26431 | - name: pytest | ||
Nikita Kniazev
|
r26992 | env: | ||
COLUMNS: 120 | ||||
Blazej Michalik
|
r26431 | run: | | ||
Matthias Bussonnier
|
r28155 | pytest --color=yes -raXxs ${{ startsWith(matrix.python-version, 'pypy') && ' ' || '--cov --cov-report=xml' }} --json-report --json-report-file=./report-${{ matrix.python-version }}-${{runner.os}}.json | ||
- uses: actions/upload-artifact@v3 | ||||
with: | ||||
name: upload pytest timing reports as json | ||||
path: | | ||||
./report-*.json | ||||
Thomas Kluyver
|
r26443 | - name: Upload coverage to Codecov | ||
krassowski
|
r27922 | uses: codecov/codecov-action@v3 | ||
with: | ||||
name: Test | ||||
files: /home/runner/work/ipython/ipython/coverage.xml | ||||