Skip to content

Commit

Permalink
Merge pull request #497 from ClearcodeHQ/setup-elasticsearch
Browse files Browse the repository at this point in the history
Change the way elasticsearch is set up - closes #468
  • Loading branch information
fizyk authored Jul 28, 2023
2 parents 02928f4 + 42842ff commit f88b784
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 77 deletions.
15 changes: 9 additions & 6 deletions .github/actions/pytest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,26 @@ runs:
uses: actions/setup-python@v3
with:
python-version: ${{ inputs.python-version }}
- name: Cache Elasticsearch installations
uses: actions/cache@v3
- uses: actions/cache@v3
with:
path: ~/es
key: es-${{ hashFiles('.install-elasticsearch.sh') }}
path: ~/elasticsearch
key: elasticsearch-${{ inputs.elasticsearch }}
- name: Setup elasticsearch
uses: ankane/setup-elasticsearch@v1
with:
elasticsearch-version: ${{ inputs.elasticsearch }}
- name: Run test
uses: fizyk/actions-reuse/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
pipenv-install-options: "--skip-lock"
command: pytest --elasticsearch-executable=/home/runner/es/elasticsearch-${{ inputs.elasticsearch }}/bin/elasticsearch -n 0 --cov-report=xml
command: pytest --elasticsearch-executable=$ES_HOME/bin/elasticsearch -n 0 --cov-report=xml
- name: Run xdist test
uses: fizyk/actions-reuse/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
pipenv-install-options: "--skip-lock"
command: pytest --elasticsearch-executable=/home/runner/es/elasticsearch-${{ inputs.elasticsearch }}/bin/elasticsearch -n 1 --cov-report=xml:coverage-xdist.xml
command: pytest --elasticsearch-executable=$ES_HOME/bin/elasticsearch -n 1 --cov-report=xml:coverage-xdist.xml
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,7 @@ on:
branches: [ main ]

jobs:
install_es:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache Elasticsearch installations
uses: actions/cache@v3
with:
path: ~/es
key: es-${{ hashFiles('.install-elasticsearch.sh') }}
- name: Install Elasticsearch
run: ./.install-elasticsearch.sh
tests_7_17:
needs: [install_es]
runs-on: ubuntu-latest
strategy:
fail-fast: true
Expand Down Expand Up @@ -82,19 +70,3 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
elasticsearch: "7.14"
tests_6_8:
needs: [install_es]
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", pypy-3.8]
env:
OS: ubuntu-latest
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pytest
with:
python-version: ${{ matrix.python-version }}
elasticsearch: "6.8.18"
43 changes: 0 additions & 43 deletions .install-elasticsearch.sh

This file was deleted.

1 change: 1 addition & 0 deletions newsfragments/486.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Switched custom elasticsearch installation script to `ankane/setup-elasticsearch@v1`

0 comments on commit f88b784

Please sign in to comment.