xonsh/.github/workflows/test.yml
Noorhteen Raja NJ 769dfbe6aa
Py 312 pre-liminary support (#5156)
* refactor: project requires 3.9+

changed as per NEP-29
https://numpy.org/neps/nep-0029-deprecation_policy.html

* test: nose type tests are deprecated in pytest now

* fix: deprecation of ast.Str and ast.Bytes and .s attribute access

* fix: deprecation of ast.Num,ast.NameConstant,ast.Ellipsis

* refactor: upgrade code to be py39+ using ruff

the changes are auto-generated

* refactor: remove typing.Annotated compatibility code

* fix: temporarily disable having xonsh syntax inside f-strings

* test: skip failing tests

there is no workaround for this version. It might get solved in the
final release though

* refactor: make XonshSession.completer lazily populated

this speedsup the tests as cmd_cache would not be actively populated
when used in default_completers function

* refactor: make presence of walrus operator default
2023-07-04 22:18:37 +05:30

74 lines
2.2 KiB
YAML

name: CI Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
tmate_debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12-dev"
name: Test Python ${{ matrix.python-version }} ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: Install dependencies
run: |
python -m pip --version
python -m pip install -e ".[test]"
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tmate_debug_enabled }}
timeout-minutes: 15
- name: Run QA Checks
if: ${{ startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python-version, '3.11') }}
run: python -m xonsh run-tests.xsh validate-news-items
- name: Run tests
if: ${{ !startsWith(matrix.python-version, '3.11') }}
run: |
python -m pip install . --no-deps
python -m xonsh run-tests.xsh test -- --timeout=240
- name: Run tests with coverage
if: ${{ startsWith(matrix.python-version, '3.11') }}
run: |
python -m pip install -e . --no-deps
python -m xonsh run-tests.xsh test --report-coverage -- --timeout=240
- name: Upload coverage to Codecov
if: ${{ startsWith(matrix.python-version, '3.11') }}
uses: codecov/codecov-action@v3
with:
verbose: true
flags: ${{ matrix.os }}