diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..476d8c4 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,56 @@ +name: Test + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: # https://docs.djangoproject.com/en/4.1/faq/install + django-version: ["3.2", "4.0", "4.1"] + python-version: ["3.7", "3.8", "3.9", "3.10"] + elastic-version: ["1.7", "2.4", "5.5", "7.13.1"] + exclude: + - django-version: "4.0" + python-version: "3.7" + - django-version: "4.1" + python-version: "3.7" + include: + - django-version: "4.1" + python-version: "3.11" + elastic-version: "7.13.1" + services: + elastic: + image: elasticsearch:${{ matrix.elastic-version }} + env: + discovery.type: "single-node" + options: >- + --health-cmd "curl http://localhost:9200/_cluster/health" + --health-interval 10s + --health-timeout 5s + --health-retries 10 + ports: + - 9200:9200 + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install system dependencies + run: sudo apt install --no-install-recommends -y gdal-bin + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + pip install coverage requests tox tox-gh-actions + pip install django==${{ matrix.django-version }} elasticsearch==${{ matrix.elastic-version }} + python setup.py clean build install + - name: Run test + run: tox -v + env: + DJANGO: ${{ matrix.django-version }}