Update Settings #15
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 all Python files except __init__.py | |
find src -name "*.py" ! -name "__init__.py" | while read filepath; do | |
# Get the directory structure within src | |
relative_path=$(dirname "$filepath" | sed 's|src/||') | |
# Create corresponding directories in the docs folder | |
mkdir -p "docs/$relative_path" | |
# Generate the pydoc HTML files | |
.venv/bin/python -m pydoc -w "$filepath" | |
# Move the generated HTML file to the correct folder | |
filename=$(basename "$filepath" .py).html | |
mv "$filename" "docs/$relative_path/" | |
done | |
- name: Commit Docs | |
env: | |
GITHUB_TOKEN: ${{ secrets.DOCS_REPO_ACCESS_TOKEN }} # Use your PAT | |
run: | | |
git config --global user.email "matthewspratlin@gmail.com" | |
git config --global user.name "Matthew Spratlin" | |
git clone https://MKS2345:${{ secrets.DOCS_REPO_ACCESS_TOKEN }}@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' |