Skip to content

Sliding Window Decoding Support #1029

Sliding Window Decoding Support

Sliding Window Decoding Support #1029

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Continuous integration
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types: [ opened, synchronize, reopened, ready_for_review ] # defaults plus ready_for_review
workflow_dispatch:
workflow_call:
jobs:
install:
name: Installation check
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install package and dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install '.[dev]'
format:
name: Lint and type check
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 2
needs: install
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install package and dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install '.[dev]'
- name: Run ruff format
id: ruff-format
run: checks/format_.py
continue-on-error: true
- name: Run ruff check
id: ruff-check
run: checks/lint_.py
continue-on-error: true
- name: Run mypy
id: mypy
run: checks/mypy_.py
continue-on-error: true
- name: Check for failures
run: |
FAILED=0
if [ ${{ steps.ruff-format.outcome }} != 'success' ]; then
echo "ruff format failed"
FAILED=1
fi
if [ ${{ steps.ruff-check.outcome }} != 'success' ]; then
echo "ruff check failed"
FAILED=2
fi
if [ ${{ steps.mypy.outcome }} != 'success' ]; then
echo "mypy failed"
FAILED=3
fi
exit $FAILED
coverage:
name: Pytest and coverage check
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 6
needs: install
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install package and dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install '.[dev]'
- name: Run coverage
run: checks/coverage_.py