Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reacticate CI jobs after switch to pyproject and setuptools #1675

Merged
merged 7 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,28 @@ on:

jobs:

poetry:

# TODO remove this line after the gpg dependency problem from #1630 and
# c1137ea9 is fixed. Until then these checks are deactivated.
if: false
python-build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
check:
- poetry check
- poetry build
python-version: ["3.8", "3.12"]

steps:
- uses: actions/checkout@v4

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

- name: Install the build module
run: pip install build

- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Build the alot package
run: python3 -m build

- name: Run check "${{ matrix.check }}"
run: "${{ matrix.check }}"

nix-flake:
runs-on: ubuntu-latest
Expand Down
32 changes: 23 additions & 9 deletions .github/workflows/test.yml-broken → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# 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:
Expand Down Expand Up @@ -38,7 +31,7 @@ jobs:
DEBIAN_FRONTEND: noninteractive

- name: clone the notmuch repository
run: git clone --depth 1 git://notmuchmail.org/git/notmuch notmuch
run: git clone --depth 1 https://git.notmuchmail.org/git/notmuch notmuch

- name: build the notmuch bindings
run: |
Expand All @@ -58,8 +51,29 @@ jobs:
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.*/\[email protected]\n&/' tests/commands/test_global.py

- name: Install dependencies
run: pip install .
run: |
pip install .

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