PyDoc #12
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: CI Workflow | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
- 'releases/*' | |
jobs: | |
sanity-tests: | |
name: Sanity Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: | | |
python -m venv .venv | |
.venv/bin/pip install -r requirements.txt | |
- name: Run sanity tests | |
env: | |
PYTHONPATH: ${{ github.workspace }} # Add workspace to PYTHONPATH | |
run: | | |
.venv/bin/pytest -v --tb=short resources/tests/sanity_tests.py -v | |
return-tests: | |
name: Return Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: | | |
python -m venv .venv | |
.venv/bin/pip install -r requirements.txt | |
- name: Run remaining return tests | |
env: | |
PYTHONPATH: ${{ github.workspace }} # Add workspace to PYTHONPATH | |
run: | | |
.venv/bin/pytest -v --tb=short resources/tests/return_tests.py | |
generate-pydoc: | |
runs-on: ubuntu-latest | |
name: Generate PyDoc Documentation | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: | | |
python -m venv .venv | |
.venv/bin/pip install -r requirements.txt | |
- name: Create PyDoc documentation | |
run: | | |
mkdir -p docs | |
find src -name "*.py" ! -name "__init__.py" | xargs .venv/bin/python -m pydoc -w | |
mv *.html docs/ | |
- name: Commit Docs | |
env: | |
GITHUB_TOKEN: ${{ secrets.DOCS_REPO_ACCESS_TOKEN }} # Use your PAT | |
run: | | |
git config --global user.email "monarchhsrobotics@gmail.com" | |
git config --global user.name "Monarch Robotics - GitHub Actions" | |
git clone https://github.com/MKS2345/BEST_LowG_Docs.git external-repo | |
rm -rf external-repo/docs | |
cp -r docs/ external-repo/docs | |
cd external-repo | |
git add . | |
git commit -m "Generate PyDoc Documentation - ${{ github.event.head_commit.message }}" | |
git push | |
- name: Clean up local docs folder | |
run: rm -rf docs | |
qodana: | |
name: Qodana | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
checks: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
# Run Python inside the Qodana Docker container | |
- name: Qodana Scan | |
uses: JetBrains/qodana-action@v2024.1 | |
with: | |
pr-mode: false | |
env: | |
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_1408482145 }} | |
QODANA_ENDPOINT: 'https://qodana.cloud' |