Skip to content

test_stub_quality

test_stub_quality #96

name: test_stub_quality
on: [ pull_request, workflow_dispatch] # Not on push to avoid wasting 15 mins CPU
env:
# Setting an environment variable with the value of a configuration variable
SNIPPET_SCORE: ${{ vars.SNIPPET_SCORE }}
GH_TOKEN_VARS: ${{ secrets.GH_TOKEN_VARS }}
# fix: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs
JUPYTER_PLATFORM_DIRS: "1"
jobs:
test_snippets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
#----------------------------------------------
- name: Install poetry # poetry is not in the default image
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11" # Replace with the Python version you're using
#----------------------------------------------
# install project
#----------------------------------------------
- name: Install dependencies for group test
run: |
python -m venv .venv
source .venv/bin/activate
pip install -r requirements-test.txt
#----------------------------------------------
# stubber clone
# repos needed for tests
#----------------------------------------------
- name: stubber clone
run: |
source .venv/bin/activate
stubber clone
# - name: update the stubs (not pushed)
# continue-on-error: true
# run: |
# source .venv/bin/activate
# pwsh -file ./update-stubs.ps1
- name: Test the snippets
continue-on-error: true
run: |
source .venv/bin/activate
pytest -m 'snippets' --cache-clear --junitxml=./results/results.xml
- name: compare and update
run: |
source .venv/bin/activate
python .github/workflows/compare_score.py