From 09f5bb697418b83f471341164d4bf1b05ba0e8f6 Mon Sep 17 00:00:00 2001 From: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> Date: Fri, 3 Nov 2023 12:10:35 +0100 Subject: [PATCH] Run SDK coverage test locally for GA --- .github/workflows/check-methods.yml | 23 ++++++++++++++++------- .github/workflows/check_python_methods.py | 10 ++++++---- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/check-methods.yml b/.github/workflows/check-methods.yml index 6b4b812646f..c00c4ba5c66 100644 --- a/.github/workflows/check-methods.yml +++ b/.github/workflows/check-methods.yml @@ -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 diff --git a/.github/workflows/check_python_methods.py b/.github/workflows/check_python_methods.py index bae7b7e4b2f..32857dd819f 100644 --- a/.github/workflows/check_python_methods.py +++ b/.github/workflows/check_python_methods.py @@ -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() @@ -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}/")