Skip to content

Commit

Permalink
Github Actions: run tests on ubuntu-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
pazz committed Sep 26, 2021
1 parent 0711474 commit e5e8e65
Showing 1 changed file with 53 additions and 21 deletions.
74 changes: 53 additions & 21 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# 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: Python application
name: alot tests

on:
push:
Expand All @@ -16,25 +13,60 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Install notmuch
run: |
sudo apt-cache search notmuch
sudo apt-get -y install python-notmuch2

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
#- name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install flake8 pytest
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
#- name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest

# we compile notmuch and new-style bindings from git master because
# ubuntu-latest does not include the python3-notmuch2 package that alot needs.
# sudo apt-get -y install python3-notmuch2
- name: Compile and install notmuch
run: |
# dependencies
sudo apt-get update
sudo apt-get install -y libxapian-dev libgmime-3.0-dev libtalloc-dev zlib1g-dev
sudo apt-get install -y swig libgpgme-dev dtach gpgsm python-cffi
set -e
# Clone the notmuch repository and move into it.
git clone git://notmuchmail.org/git/notmuch --depth 1
cd notmuch
# Make and install the library.
./configure \
--without-bash-completion \
--without-api-docs \
--without-emacs \
--without-desktop \
--without-ruby \
--without-zsh-completion
make -j3 -l2
sudo make install
# Move out of the notmuch dir again.
cd ../../..
- name: Install notmuch2 python bindings
run: |
pytest
cd notmuch/bindings/python-cffi
pip install .
# Move out of the notmuch dir again.
cd ../../..
# test bindings
python -c "import notmuch2"
- name: Install alot's dependencies
run: |
sudo apt-get install -y gnupg2
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with distutils
run: |
python setup.py test
# TODO: test with different python versions
# TODO: test docs generation
# TODO: upload coverage

0 comments on commit e5e8e65

Please sign in to comment.