Merge branch 'dev' of https://github.com/VirtualFlyBrain/VFBquery int… #365
This file contains hidden or 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 VFBquery Examples | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: # Enables manual triggering | |
| schedule: | |
| - cron: '0 0 1 * *' # Runs at 00:00 UTC on the 1st day of every month | |
| jobs: | |
| test-examples: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.8 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install deepdiff colorama | |
| pip install . | |
| - name: Run examples from README.md | |
| run: | | |
| cat README.md | grep -e '```python' -e '```' -e '^[^`]*$' | sed -e '/^```python/,/^```/!d' -e '/^```/d' -e 's/\(vfb.[^)]*)\)/print(\1)/g' > test_examples.py | |
| cat test_examples.py | |
| python test_examples.py | |
| - name: Parse README.md and generate test files | |
| run: | | |
| python -m src.test.readme_parser | |
| env: | |
| PYTHONPATH: ${{ github.workspace }} | |
| - name: Run examples from README.md and compare JSON outputs | |
| run: | | |
| python -m src.test.test_examples_diff | |
| env: | |
| PYTHONPATH: ${{ github.workspace }} |