Changes to restore Python 3.8 compatibility #11
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: api-docs | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
if: | | |
github.repository != 'CogStack/CogStack-ModelServe' && | |
github.ref == 'refs/heads/master' && | |
github.event_name == 'push' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ 3.9 ] | |
max-parallel: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r app/requirements.txt -r app/requirements-dev.txt | |
- name: Check the CLI doc | |
run: | | |
typer app/cli/cli.py utils docs --output cli.md | |
if ! cmp -s cli.md app/cli/README.md; then | |
echo "The CMS CLI README needs updating" | |
exit 1 | |
fi | |
- name: Generate API docs | |
run: | | |
python app/cli/cli.py export-model-apis --model-type medcat_snomed --add-training-apis --no-exclude-unsupervised-training --no-exclude-metacat-training --add-evaluation-apis --add-previews-apis | |
python app/cli/cli.py export-model-apis --model-type medcat_icd10 --add-training-apis --no-exclude-unsupervised-training --no-exclude-metacat-training --add-evaluation-apis --add-previews-apis | |
python app/cli/cli.py export-model-apis --model-type medcat_umls --add-training-apis --no-exclude-unsupervised-training --no-exclude-metacat-training --add-evaluation-apis --add-previews-apis | |
python app/cli/cli.py export-model-apis --model-type medcat_deid --add-training-apis --add-evaluation-apis --add-previews-apis --exclude-metacat-training --exclude-unsupervised-training | |
python app/cli/cli.py export-model-apis --model-type transformers_deid --add-training-apis --add-evaluation-apis --add-previews-apis --exclude-metacat-training --exclude-unsupervised-training | |
python app/cli/cli.py export-openapi-spec | |
git fetch origin gh-pages:gh-pages | |
git checkout gh-pages | |
mv ./medcat_snomed_model_apis.json ./docs/medcat_snomed_model_apis.json | |
mv ./medcat_icd10_model_apis.json ./docs/medcat_icd10_model_apis.json | |
mv ./medcat_umls_model_apis.json ./docs/medcat_umls_model_apis.json | |
mv ./medcat_deid_model_apis.json ./docs/medcat_deid_model_apis.json | |
mv ./transformers_deid_model_apis.json ./docs/transformers_deid_model_apis.json | |
mv ./cogstack_model_serve_apis.json ./docs/cogstack_model_serve_apis.json | |
git config --global user.name "Xi Bai" | |
git config --global user.email "[email protected]" | |
git add ./docs/medcat_snomed_model_apis.json ./docs/medcat_icd10_model_apis.json ./docs/medcat_umls_model_apis.json ./docs/medcat_deid_model_apis.json ./docs/transformers_deid_model_apis.json ./docs/cogstack_model_serve_apis.json | |
if [[ `git status --porcelain --untracked-files=no` ]]; then | |
git commit -m "update api docs" | |
else | |
echo "No API doc changes detected and publishing skipped." | |
exit 0 | |
fi | |
- name: Update API docs | |
uses: ad-m/github-push-action@master | |
with: | |
branch: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} |