Skip to content

Commit

Permalink
Run SDK coverage test locally for GA
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed Nov 3, 2023
1 parent 7d6eb6a commit 09f5bb6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/check-methods.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
name: Check Python SDK method coverage

on:
workflow_run:
workflows: [pr-deploy-and-comment]
types:
- completed
workflow_dispatch:
pull_request:

jobs:
python-methods:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
continue-on-error: true

steps:
- name: Checkout Push/Workflow Dispatch
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: true # Fetch Hugo themes
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Set up Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
extended: true
- name: Build
run: make build-dist
- name: LS
run: ls
- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip" # caching pip dependencies
- run: pip install beautifulsoup4 markdownify argparse
- name: "Check Python SDK method coverage"
run: python3 .github/workflows/check_python_methods.py --pr ${{ github.event.number }}
run: python3 .github/workflows/check_python_methods.py --local
10 changes: 6 additions & 4 deletions .github/workflows/check_python_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


parser = argparse.ArgumentParser()
parser.add_argument('--pr', type=str, required=False)
parser.add_argument('--local', action='store_true', required=False)

args = parser.parse_args()

Expand Down Expand Up @@ -191,11 +191,13 @@ def parse(type, names):


# Parse the Docs site's service page
if args.pr:
if args.local:
if type == "app" or type == "robot":
soup2 = make_soup(f"https://docs-test.viam.dev/{pr_num}/public/program/apis/{service}/")
with open(f"public/program/apis/{service}/index.html") as fp:
soup2 = BeautifulSoup(fp, 'html.parser')
else:
soup2 = make_soup(f"https://docs-test.viam.dev/{pr_num}/public/{type}/{service}/")
with open(f"public/{type}/{service}/index.html") as fp:
soup2 = BeautifulSoup(fp, 'html.parser')
else:
if type == "app" or type == "robot":
soup2 = make_soup(f"https://docs.viam.com/program/apis/{service}/")
Expand Down

0 comments on commit 09f5bb6

Please sign in to comment.