Skip to content

Commit 9520f3f

Browse files
committed
Fix SOLR availability check to correctly handle exceptions and update GITHUB_ENV
1 parent 9c73fa9 commit 9520f3f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/examples.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ jobs:
2525
result = vfb.get_term_info('FBbt_00003748')
2626
with open(os.environ['GITHUB_ENV'], 'a') as f:
2727
f.write('SOLR_AVAILABLE=true\n')
28+
print('SOLR is available')
2829
except Exception as e:
2930
print('SOLR not available:', e)
3031
with open(os.environ['GITHUB_ENV'], 'a') as f:
3132
f.write('SOLR_AVAILABLE=false\n')
33+
exit(1)
3234
"
3335
- name: Install dependencies
3436
run: |
@@ -42,13 +44,13 @@ jobs:
4244
cat test_examples.py
4345
export VFBQUERY_CACHE_ENABLED=false
4446
python test_examples.py
45-
if: env.SOLR_AVAILABLE == 'true'
4647
- name: Parse README.md and generate test files
4748
run: |
4849
python -m src.test.readme_parser
4950
env:
5051
PYTHONPATH: ${{ github.workspace }}
5152
if: env.SOLR_AVAILABLE == 'true'
53+
if: env.SOLR_AVAILABLE == 'true'
5254
- name: Run examples from README.md and compare JSON outputs
5355
run: |
5456
python -m src.test.test_examples_diff

0 commit comments

Comments
 (0)