Resolve fetch failures: New csets w/ 0 members #259
This file contains 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: "Resolve fetch failures: New csets w/ 0 members" | |
on: | |
schedule: | |
- cron: '0 7 * * *' # every day 7am GMT (2-3am EST/EDT) | |
workflow_dispatch: | |
inputs: | |
version_id: | |
description: 'Concept set version ID' | |
required: false | |
# type: string # integer not supported; type will be corrected by script | |
jobs: | |
resolve-fetch-failures-0-members: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Set up Python version | |
uses: actions/setup-python@v2 | |
with: | |
# Consider '3.10' or 'v3.10.0': https://github.com/actions/setup-python/issues/160 | |
python-version: '3.9' | |
- name: Print commit hash & branch for rollbacks & troubleshooting | |
run: | | |
echo "Commit hash: ${{ github.sha }}" | |
echo "Branch: ${{ github.ref }}" | |
- name: 'Create env file' | |
run: | | |
mkdir env | |
echo "${{ secrets.ENV_FILE }}" > env/.env | |
- name: Create and start virtual environment | |
run: | | |
python3 -m venv venv | |
source venv/bin/activate | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade wheel | |
pip install --upgrade setuptools | |
pip install -r requirements.txt | |
- name: Resolve fetch failures | |
run: | | |
if [ -z "${{ github.event.inputs.version_id }}" ]; then | |
python backend/db/resolve_fetch_failures_0_members.py | |
else | |
python backend/db/resolve_fetch_failures_0_members.py --version-id ${{ github.event.inputs.version_id }} | |
fi |