feat:SP-1846 Adds sbom-format flag to inspect undeclared command #234
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: Build/Test Local Python Package | |
# This workflow will upload a TestPyPI Python Package using Twine on demand (dispatch) | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10.x" | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
- name: Build Local Package | |
run: make dist | |
- name: Install Test Package | |
run: | | |
pip install -r requirements.txt | |
pip install dist/scanoss-*-py3-none-any.whl | |
which scanoss-py | |
- name: Run Tests | |
run: | | |
which scanoss-py | |
scanoss-py version | |
scanoss-py utils fast | |
scanoss-py scan tests > results.json | |
id_count=$(cat results.json | grep '"id":' | wc -l) | |
echo "ID Count: $id_count" | |
if [[ $id_count -lt 1 ]]; then | |
echo "Error: Scan test did not produce any results. Failing" | |
exit 1 | |
fi | |
- name: Run Tests (fast winnowing) | |
run: | | |
pip install scanoss_winnowing | |
which scanoss-py | |
scanoss-py version | |
scanoss-py utils fast | |
scanoss-py scan tests > results.json | |
id_count=$(cat results.json | grep '"id":' | wc -l) | |
echo "ID Count: $id_count" | |
if [[ $id_count -lt 1 ]]; then | |
echo "Error: Scan test did not produce any results. Failing" | |
exit 1 | |
fi | |
- name: Run Tests HPSM (fast winnowing) | |
run: | | |
pip install scanoss_winnowing | |
which scanoss-py | |
scanoss-py version | |
scanoss-py utils fast | |
scanoss-py wfp -H tests > fingers.wfp | |
wfp_count=$(cat fingers.wfp | grep 'file=' | wc -l) | |
echo "WFP Count: $wfp_count" | |
if [[ $wfp_count -lt 1 ]]; then | |
echo "Error: WFP test did not produce any results. Failing" | |
exit 1 | |
fi | |
- name: Run Unit Tests | |
run: | | |
python -m unittest | |