File: test.yml

package info (click to toggle)
alot 0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,748 kB
  • sloc: python: 11,317; makefile: 125; sh: 8
file content (79 lines) | stat: -rw-r--r-- 2,885 bytes parent folder | download
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
name: Run tests

on:
  - push
  - pull_request

jobs:

  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]

    steps:
      - uses: actions/checkout@v4

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}

      - 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 \
            libgpgme-dev libxapian-dev libgmime-3.0-dev libtalloc-dev swig
        env:
          DEBIAN_FRONTEND: noninteractive

      - 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: Install notmuch python bindings
        run: pip install .
        working-directory: notmuch/bindings/python-cffi

      - name: "Workaround for issue #1630: mock gpg instead of installing it"
        # FIXME: It is very difficult to install a recent gpg package in ci.
        # This is related to issue 1630 (see
        # https://github.com/pazz/alot/issues/1630#issuecomment-1938174029 and
        # onwards).  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.
        run: |
          # do not install gpg with pip
          sed -i /gpg/d pyproject.toml
          # mock a minimal structure of the gpg module
          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
          # skip all tests that depend on gpg
          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: Install dependencies
        run: |
          pip install .

      - name: Run tests
        run: python3 -m unittest --verbose