-
Notifications
You must be signed in to change notification settings - Fork 164
130 lines (108 loc) · 4.51 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# WARNING: This workflow is deactivated until the gpg dependency problem from
# issue 1630 (see
# https://github.com/pazz/alot/issues/1630#issuecomment-1938174029 and
# onwards) is fixed. The problem was introduced in c1137ea9: the gpg
# dependency is required with version > 1.10.0 and such a version is not
# currently available on PyPI but must be build from hand.
name: Run tests
on:
- push
- pull_request
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
#- "3.8"
#- "3.9"
#- "3.10"
#- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v4
# https://notmuchmail.org/releases/ notmuch-0.38.3.tar.xz
- name: Install dependencies for the gpg and notmuch python package
run: |
set -e
sudo apt-get update
sudo apt-get install -y --no-install-recommends apt-rdepends
sudo apt-get install -y --no-install-recommends \
libgpgme-dev libxapian-dev libgmime-3.0-dev libtalloc-dev swig \
python3 python3-dev \
libpython3-all-dev python3-all-dev \
$(apt-rdepends python3-gpg | grep -v "^ " |grep -v debconf | grep -v pinentry)
env:
DEBIAN_FRONTEND: noninteractive
# - name: Update the gpg dependency in the pyproject file
# # 1.16 is the version of gpgme that is currently available in ubuntu-latest (currently 22.04)
# run: sed -i 's|gpg>1.10.0|gpg @ https://dev.gnupg.org/source/gpgme.git@gpgme-1.16.0|' pyproject.toml
#- name: Clone the gpgme repository
# run: git clone --depth 1 --branch gpgme-1.17.0 https://dev.gnupg.org/source/gpgme.git gpgme
#- name: Download gpgme
# run: |
# wget https://gnupg.org/ftp/gcrypt/gpgme/gpgme-$VERSION.tar.bz2 https://gnupg.org/ftp/gcrypt/gpgme/gpgme-$VERSION.tar.bz2.sig
# curl https://gnupg.org/signature_key.asc | gpg --import
# for k in BCEF7E294B092E28 528897B826403ADA 528897B826403ADA E98E9B2D19C6C8BD E98E9B2D19C6C8BD 549E695E905BA208 549E695E905BA208; do
# gpg -k $k
# done
# gpg --verify gpgme-$VERSION.tar.bz2.sig gpgme-$VERSION.tar.bz2
# tar -xf gpgme-$VERSION.tar.bz2
# mv gpgme-$VERSION gpgme
# env:
# VERSION: 1.19.0
#- name: Build the gpgme bindings
# run: |
# ls -l $(which -a python python3)
# set -e
# ./autogen.sh
# ./configure --enable-maintainer-mode --enable-languages=python
# make
# sudo make install
# working-directory: gpgme
# env:
# PYTHON: /usr/bin/python3
#- name: debug gpgme result
# run: find
# working-directory: gpgme
- name: clone the notmuch repository
run: git clone --depth 1 https://git.notmuchmail.org/git/notmuch notmuch
- name: build the notmuch bindings
run: |
set -e
# Make and install the library.
./configure --without-bash-completion \
--without-api-docs \
--without-emacs \
--without-desktop \
--without-ruby \
--without-zsh-completion
make
sudo make install
working-directory: notmuch
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install notmuch python bindings
run: pip install .
working-directory: notmuch/bindings/python-cffi
#- name: Install gpgme python bindings
# run: pip install .
# working-directory: gpgme/lang/python
- name: Install dependencies
run: |
sed -i /gpg/d pyproject.toml
pip install .
- name: Mock the gpg library
run: |
mkdir -p gpg/constants
echo from . import constants > gpg/__init__.py
echo from . import validity > gpg/constants/__init__.py
echo FULL = 4 > gpg/constants/validity.py
sed -i '/import unittest/araise unittest.SkipTest("gpg based test do not work in CI")\n' tests/test_crypto.py
sed -i 's/\( *\)def setUpClass.*/&\n\1 raise unittest.SkipTest("gpg based test do not work in CI")\n/' tests/db/test_utils.py
sed -i 's/\( *\)async def test_no_spawn_no_stdin_attached.*/\1@unittest.skip\n&/' tests/commands/test_global.py
- name: Run tests
run: python3 -m unittest --verbose