Skip to content

Commit 4b1da00

Browse files
Speed up Solr in GitHub workflow
1 parent 284e415 commit 4b1da00

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

‎.github/workflows/im-build.yml‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
pull_request:
66

7+
env:
8+
SOLR_VERSION: 8.6.2
79
jobs:
810
build:
911

@@ -34,6 +36,11 @@ jobs:
3436
uses: actions/setup-python@v5
3537
with:
3638
python-version: '3.10'
39+
- name: Setup Apache Solr
40+
uses: DhavalGojiya/setup-solr-action@v1.2.0
41+
with:
42+
solr-version: ${{ env.SOLR_VERSION }}
43+
solr-core-name: 'intermine-search'
3744
- name: Change apt mirror
3845
run: |
3946
set -euo pipefail
@@ -44,7 +51,7 @@ jobs:
4451
- name: Install dependencies
4552
run: |
4653
set -euo pipefail
47-
sudo apt-get install libxml2-dev libxslt-dev python3-dev
54+
sudo apt-get install -y libxml2-dev libxslt-dev python3-dev wait-for-it
4855
python -m pip install --upgrade pip
4956
pip install -U setuptools
5057
pip install -r requirements.txt
@@ -54,10 +61,16 @@ jobs:
5461
sudo apt-get update -y
5562
sudo apt-get install -y libpq-dev postgresql-client
5663
sudo service postgresql start
64+
- name: Create additional Solr core
65+
run: |
66+
set -euo pipefail
67+
wait-for-it localhost:8983
68+
docker ps
69+
SOLR_CONTAINER=$(docker ps -f ancestor=solr:"$SOLR_VERSION" --format '{{.ID}}' | head -n1)
70+
docker exec "$SOLR_CONTAINER" /opt/solr/bin/solr create -c intermine-autocomplete
5771
- name: Run unit tests
5872
run: |
5973
set -euo pipefail
60-
./config/ci/init-solr.sh ${GITHUB_WORKSPACE}
6174
./config/ci/init.sh ${GITHUB_WORKSPACE} $(which python3) http://localhost:8080/intermine-demo
6275
python setup.py test
6376
python setup.py livetest

0 commit comments

Comments
 (0)