COHD API Monitoring Workflow #2389
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
| # This workflow periodically makes calls to the COHD API to verify it's operating as expected | |
| name: COHD API Monitoring Workflow | |
| on: | |
| # Schedule this workflow to run twice a day (at 0300 and 1500 UTC) | |
| schedule: | |
| - cron: '0 15 * * *' | |
| # Also allow manually triggering this workflow_dispatch: | |
| workflow_dispatch: | |
| jobs: | |
| monitor: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python 3 | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: 3.11.x | |
| - name: Install dependencies | |
| id: dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest requests pandas matplotlib linkml-runtime bmt reasoner-validator>=4.0.0 flask flask-cors flask-caching | |
| pip show reasoner-validator | |
| # Run /health checks on all COHD instances (dev, CI, Test, Prod) | |
| - name: Test all COHD instances alive | |
| if: success() || (failure() && steps.dependencies.conclusion == 'success') # Run even if other tests fail | |
| # pytest -s disables pytest from capturing print statements (i.e., print statements will appear in console) | |
| run: | | |
| pytest -s test_alive.py | |
| # Test cohd.io by running pytest on test_cohd_io.py | |
| - name: Test COHD REST API | |
| if: success() || (failure() && steps.dependencies.conclusion == 'success') # Run even if other tests fail | |
| run: | | |
| pytest -s test_cohd_io.py | |
| # Test COHD TRAPI endpoints by running pytest on test_cohd_trapi.py | |
| - name: Test COHD TRAPI | |
| if: success() || (failure() && steps.dependencies.conclusion == 'success') # Run even if other tests fail | |
| run: | | |
| pytest -s test_cohd_trapi.py | |
| # Test covid.cohd.io by running pytest on test_cohd_covid_io.py | |
| - name: Test covid.cohd.io | |
| if: success() || (failure() && steps.dependencies.conclusion == 'success') # Run even if other tests fail | |
| run: | | |
| pytest -s test_cohd_covid_io.py |