move global variables to class variables #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
ruff: # https://docs.astral.sh/ruff | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: pip install --user ruff | |
- run: ruff --output-format=github | |
test: | |
runs-on: ubuntu-latest | |
needs: ruff # Do not run the tests if linting fails. | |
strategy: | |
fail-fast: false | |
matrix: # https://docs.djangoproject.com/en/stable/faq/install/#what-python-version-can-i-use-with-django | |
django-version: ["3.2", "4.2", "5.0"] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
elastic-version: ["7.17.9"] | |
exclude: | |
- django-version: "3.2" | |
python-version: "3.11" | |
- django-version: "3.2" | |
python-version: "3.12" | |
- django-version: "5.0" | |
python-version: "3.8" | |
- django-version: "5.0" | |
python-version: "3.9" | |
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 | |
solr: | |
image: solr:6 | |
ports: | |
- 9001:8983 | |
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 system dependencies | |
run: sudo apt install --no-install-recommends -y gdal-bin | |
- name: Setup solr test server in Docker | |
run: bash test_haystack/solr_tests/server/setup-solr-test-server-in-docker.sh | |
- 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 }} | |
pip install --editable . | |
- name: Run test | |
run: tox -v | |
env: | |
DJANGO: ${{ matrix.django-version }} |