Skip to content

Commit

Permalink
Merge pull request #1851 from jorgenschaefer/switch-to-github-actions
Browse files Browse the repository at this point in the history
Switch to github actions
  • Loading branch information
galaunay committed Nov 15, 2020
2 parents e559220 + 5861fdb commit a1fe982
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 113 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Tests

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
emacs_version:
# - 24.1
# - 24.2
# - 24.3
# - 24.4
# - 24.5
# - 25.1
# - 25.2
# - 25.3
- 26.1
- 26.2
- 26.3
- 27.1
# - snapshot
python_version:
- 2.7
- 3.5
- 3.6
- 3.7
- 3.8
steps:
# Checkout
- uses: actions/checkout@v2
# 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@v2
with:
python-version : ${{ matrix.python_version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt --upgrade
pip install -r requirements-rpc.txt --upgrade
pip install -r requirements-dev.txt --upgrade
if [[ ${{ matrix.python_version }} > 3.5 ]] ; then
pip install -r requirements-rpc3.6.txt --upgrade ;
fi
if [[ ${{ matrix.python_version }} < 3 ]] ; then
pip install -r requirements-dev2.txt --upgrade ;
fi
pip install coveralls
python -m virtualenv $HOME/.virtualenvs/elpy-test-venv
# Run tests
- name: Run Python tests
run: nosetests
- name: Run Emacs tests
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 3
command: cask install ; PYTHONPATH="`pwd`" cask exec ert-runner --reporter ert+duration
# Coveralls
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ ${{ matrix.python_version }} > 3 ]] ; then
coverage run -m nose.__main__
coveralls ;
fi
79 changes: 0 additions & 79 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

.. image:: https://secure.travis-ci.org/jorgenschaefer/elpy.svg?branch=master
:target: http://travis-ci.org/jorgenschaefer/elpy?branch=master
.. image:: https://github.com/jorgenschaefer/elpy/workflows/Tests/badge.svg?branch=master
:target: https://github.com/jorgenschaefer/elpy/actions?query=workflow%3ATests

.. image:: https://readthedocs.org/projects/elpy/badge/?version=latest
:target: https://elpy.readthedocs.io/en/latest/?badge=latest
Expand Down Expand Up @@ -86,7 +86,7 @@ Please have a look at the documentation at `Readthedocs`_ if you want to know mo

External resources
===================

- `Emacs: The Best Python Editor?`_ by Jon Fincher
- `Managing a Python development environment in Emacs`_ by Diego Fernández Giraldo
- `Configuring GNU emacs with elpy on MacOS`_ by Kenneth H. East
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ mock==3.0.5
nose==1.3.7
twine==1.15.0
wheel==0.34.2
virtualenv==20.1.0
6 changes: 4 additions & 2 deletions test/elpy-format-code-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
(should (string= backend-called "autopep8"))
)))

(ert-deftest elpy-should-format-code-with-autopep8-formatter ()
(ert-deftest elpy-should-format-code-with-black-formatter ()
(let ((elpy-formatter 'black)
backend-called)
(elpy-testcase ()
Expand All @@ -56,7 +56,9 @@
"x = 3")

(mletf* ((elpy-black-fix-code ()
(setq backend-called "black")))
(setq backend-called "black"))
(elpy-config--package-available-p (formatter)
t))
(call-interactively 'elpy-format-code))

(should (string= backend-called "black"))
Expand Down
4 changes: 2 additions & 2 deletions test/elpy-rpc-get-virtualenv-path-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
(elpy-testcase ()
(let ((elpy-rpc-virtualenv-path 'current)
(old-venv pyvenv-virtual-env))
(should (string-match "\\(travis/virtualenv/python\\|.virtualenvs/elpy\\)"
(elpy-rpc-get-virtualenv-path)))
(should-not (string-match "elpy-test-venv"
(elpy-rpc-get-virtualenv-path)))
(pyvenv-workon "elpy-test-venv")
(should (string-match "elpy-test-venv" (elpy-rpc-get-virtualenv-path)))
(if old-venv
Expand Down
2 changes: 1 addition & 1 deletion test/elpy-shell-send-file-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(elpy-testcase ()
(elpy-enable)
(python-mode)
(let ((test-string (make-string 6000 ?a))
(let ((test-string (make-string 3000 ?a))
(process (elpy-shell-get-or-create-process)))
(python-shell-send-string
(format "print('start');foo='%s';print('end');" test-string) process)
Expand Down
26 changes: 0 additions & 26 deletions travis-evm-cask.sh

This file was deleted.

0 comments on commit a1fe982

Please sign in to comment.