Update elips, python tests and only support latest emacs version (#2065) #177
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| # continue-on-error: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| emacs_version: | |
| - 30.1 | |
| - 30.2 | |
| # - snapshot | |
| python_version: | |
| - 3.12 | |
| steps: | |
| # Checkout | |
| - uses: actions/checkout@v4 | |
| # Emacs | |
| - name: Set up Emacs ${{ matrix.emacs_version }} | |
| uses: purcell/setup-emacs@master | |
| with: | |
| version: ${{ matrix.emacs_version }} | |
| # Cask | |
| - name: Set up Cask | |
| uses: conao3/setup-cask@master | |
| with: | |
| version: 'snapshot' | |
| # Python | |
| - name: Set up Python ${{ matrix.python_version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version : ${{ matrix.python_version }} | |
| check-latest: true | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Install Python dependencies | |
| run: | | |
| uv pip install --system -r requirements.txt --upgrade | |
| uv pip install --system -r requirements-rpc.txt --upgrade | |
| uv pip install --system -r requirements-rpc3.6.txt --upgrade | |
| uv pip install --system -r requirements-dev.txt --upgrade | |
| uv pip install --system coveralls | |
| uv venv $HOME/.virtualenvs/elpy-test-venv | |
| # Run tests | |
| - name: Run Emacs tests | |
| uses: nick-invision/retry@v3 | |
| with: | |
| timeout_minutes: 10 | |
| max_attempts: 2 | |
| command: | | |
| cask install | |
| # ert-runner can exit 255 due to a benign "Selecting deleted buffer" | |
| # error during Emacs shutdown (race condition in process cleanup). | |
| # Capture output and check for actual test failures instead. | |
| set +e | |
| output=$(PYTHONPATH="$(pwd)" cask exec ert-runner --reporter ert+duration 2>&1) | |
| rc=$? | |
| echo "$output" | |
| if echo "$output" | grep -q "unexpected results"; then | |
| exit 1 | |
| fi | |
| exit 0 | |
| - name: Run Python tests | |
| run: python -m unittest discover elpy | |
| # Coveralls | |
| - name: Coveralls | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| if [[ ${{ matrix.python_version }} > 3 ]] ; then | |
| coverage run -m unittest discover elpy | |
| coveralls --service=github ; | |
| fi |