From 02fe642d132a90ce86cde1bfb1124904978c9cbf Mon Sep 17 00:00:00 2001 From: Terri Oda Date: Tue, 24 Oct 2023 09:25:54 -0700 Subject: [PATCH] fix: experiment with different if construction --- .github/workflows/testing.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 2440af38a0..2cb75473e0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -58,8 +58,8 @@ jobs: tests: name: Linux tests - if: | - ! github.event.pull_request.user.login == 'github-actions[bot]' || + env: + RUN_TESTS: ${{ ! github.event.pull_request.user.login == 'github-actions[bot]' || ! ( startsWith(github.head_ref, 'chore-sbom-py') || contains( @@ -67,6 +67,7 @@ jobs: github.head_ref ) ) + }} runs-on: ubuntu-22.04 strategy: matrix: @@ -109,6 +110,7 @@ jobs: - name: Install OS dependencies for testing PDF run: sudo apt-get install build-essential libpoppler-cpp-dev pkg-config python3-dev - name: Install pdftotext, reportlab and cve-bin-tool + if: $RUN_TESTS run: | python -m pip install --upgrade pip python -m pip install --upgrade setuptools @@ -118,11 +120,13 @@ jobs: python -m pip install --upgrade -r dev-requirements.txt python -m pip install --upgrade . - name: Try single CLI run of tool + if: $RUN_TESTS run: | [[ -e cache ]] && mkdir -p .cache && mv cache ~/.cache/cve-bin-tool NO_EXIT_CVE_NUM=1 python -m cve_bin_tool.cli test/assets/test-kerberos-5-1.15.1.out cp -r ~/.cache/cve-bin-tool cache - name: Run async tests + if: $RUN_TESTS run: > pytest -n 4 -v --ignore=test/test_cli.py @@ -131,6 +135,7 @@ jobs: --ignore=test/test_html.py --ignore=test/test_json.py - name: Run synchronous tests + if: $RUN_TESTS run: > pytest -v test/test_cli.py