From 43b658ff1e168a08844fea17351d5887614753d2 Mon Sep 17 00:00:00 2001 From: Caroline Russell Date: Mon, 16 Dec 2024 14:44:53 -0500 Subject: [PATCH] Move cdxgen checkout to address yarn vs pnpm issue. Signed-off-by: Caroline Russell --- .github/workflows/snapshot-tests.yml | 18 +++++++++++------- test/diff/generate.py | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/snapshot-tests.yml b/.github/workflows/snapshot-tests.yml index faf18f7b4..f5d85e5ad 100644 --- a/.github/workflows/snapshot-tests.yml +++ b/.github/workflows/snapshot-tests.yml @@ -22,9 +22,8 @@ jobs: steps: - uses: actions/checkout@v4 - - - name: Set up pnpm - uses: pnpm/action-setup@v4 + with: + path: cdxgen_src - name: cdxgen, custom-json-diff installs shell: bash @@ -32,16 +31,21 @@ jobs: SHELL: bash run: | rm -rf original_snapshots new_snapshots src_repos + cd cdxgen_src + corepack enable pnpm cdxgen_tarball=$(pnpm pack | tail -1) npm install -g "$cdxgen_tarball" - git clone https://github.com/appthreat/cdxgen-samples.git original_snapshots + cd .. python3.12 -m venv .venv - source .venv/bin/activate && pip install -r test/diff/requirements.txt + source .venv/bin/activate && pip install -r cdxgen_src/test/diff/requirements.txt + git clone https://github.com/appthreat/cdxgen-samples.git original_snapshots + cd original_snapshots + git checkout feature/expand_snapshots_3 - name: Generate scripts run: | source .venv/bin/activate - python test/diff/generate.py + python cdxgen_src/test/diff/generate.py - name: Upload shell scripts generated as artifact uses: actions/upload-artifact@v4 @@ -65,7 +69,7 @@ jobs: - name: Test BOMs run: | source .venv/bin/activate - python test/diff/diff_tests.py --migrate-legacy + python cdxgen_src/test/diff/diff_tests.py --migrate-legacy if test -f new_snapshots/diffs.json; then echo "status=FAILED" >> "$GITHUB_ENV" fi diff --git a/test/diff/generate.py b/test/diff/generate.py index ac6ac318a..9eeb49926 100644 --- a/test/diff/generate.py +++ b/test/diff/generate.py @@ -18,7 +18,7 @@ def build_args(): parser.add_argument( '--repo-csv', type=Path, - default='test/diff/repos.csv', + default='cdxgen_src/test/diff/repos.csv', help='Path to sources.csv', dest='repo_csv' )