|
| 1 | +name: "Tests" |
| 2 | + |
| 3 | +on: [push, pull_request, workflow_dispatch] |
| 4 | + |
| 5 | +permissions: {} |
| 6 | + |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 9 | + cancel-in-progress: true |
| 10 | + |
| 11 | +jobs: |
| 12 | + test: |
| 13 | + name: "tox -v" |
| 14 | + runs-on: ubuntu-24.04 |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + django-version: ["4.2"] |
| 19 | + python-version: ["3.8", "3.9", "3.10"] |
| 20 | + elastic-version: ["1.7", "2.4", "5.5", "7.13.1"] |
| 21 | + |
| 22 | + services: |
| 23 | + elastic: |
| 24 | + # TODO: Revisit pinning strategy |
| 25 | + image: elasticsearch:${{ matrix.elastic-version }} # zizmor: ignore[unpinned-images] |
| 26 | + env: |
| 27 | + discovery.type: "single-node" |
| 28 | + options: >- |
| 29 | + --health-cmd "curl http://localhost:9200/_cluster/health" |
| 30 | + --health-interval 10s |
| 31 | + --health-timeout 5s |
| 32 | + --health-retries 10 |
| 33 | + ports: |
| 34 | + - 9200:9200 |
| 35 | + |
| 36 | + steps: |
| 37 | + - name: Checkout |
| 38 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 39 | + with: |
| 40 | + persist-credentials: false |
| 41 | + |
| 42 | + - name: Set up Python ${{ matrix.python-version }} |
| 43 | + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 |
| 44 | + with: |
| 45 | + python-version: ${{ matrix.python-version }} |
| 46 | + |
| 47 | + - name: Install system dependencies |
| 48 | + run: sudo apt install --no-install-recommends -y gdal-bin |
| 49 | + |
| 50 | + - name: Run tests with Django ${{ matrix.django-version }} and Elasticsearch ${{ matrix.elastic-version }} |
| 51 | + # FIXME: Find a way to remove zizmor ignore |
| 52 | + run: | # zizmor: ignore[template-injection] |
| 53 | + python -m pip install --upgrade pip setuptools wheel |
| 54 | + pip install coverage pytz |
| 55 | + pip install django==${{ matrix.django-version }} elasticsearch==${{ matrix.elastic-version }} |
| 56 | + pip install --editable . |
| 57 | + coverage run tests/run_tests.py |
0 commit comments