notanumber / xapian-haystack

A Xapian backend for Haystack
GNU General Public License v2.0
154 stars 93 forks source link

Replace Travis CI by GitHub Actions #198

Closed claudep closed 3 years ago

claudep commented 3 years ago

I'm currently struggling to find the correct paths to copy files between django-haystack and xapian-haystack checkouts.

claudep commented 3 years ago

Now I'm blocked on how to use the system python3-xapian when running any python command...

claudep commented 3 years ago

I was finally able to set PYTHONPATH, but the system-installed python3-xapian is version specific, so it cannot be used with different Python versions. Looks like we have no other choice than building xapian in each test run, which is resource wasting IMHO.

asedeno commented 3 years ago

Using #201 and actions/cache@v2 to cache the wheel, you'll have a better time.

- name: Check for cached xapian wheel
  id: xapian-cache
  uses: actions/cache@v2
  with:
    path: xapian*.whl
    key: xapian-${{ matrix.xapian-version }}-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('xapian_wheel_builder.sh') }}
- name: Build xapian wheel
  if: steps.xapian-cache.outputs.cache-hit != 'true'
  run: |
    ./xapian_wheel_builder.sh ${{ matrix.xapian-version }}

This leads to a cache key that looks something like this: xapian-1.4.9-Linux-/opt/hostedtoolcache/Python/3.6.14/x64-3102be70278fa7f0245c13c9aadfdd7c6caa11774c7374646652f70378e2887b and a wheel named something like: xapian-1.4.9-cp36-cp36m-linux_x86_64.whl

Once you've built or pulled the wheel from cache, install as you would any wheel.

claudep commented 3 years ago

@asedeno, Now that #201 is in, do you want/have time to take this patch and finish it with the cached wheels?

asedeno commented 3 years ago

@claudep, I've got something going on my fork, but the wheel builder does not bring along a xapian-delve so the tests fail. I'll try to look into that.

claudep commented 3 years ago

I'd be grateful!

asedeno commented 3 years ago

@claudep, here's what I have cooking: