Skip to content

Commit

Permalink
Move cdxgen checkout to address yarn vs pnpm issue.
Browse files Browse the repository at this point in the history
Signed-off-by: Caroline Russell <caroline@appthreat.dev>
  • Loading branch information
cerrussell committed Dec 24, 2024
1 parent 19422c5 commit 43b658f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/snapshot-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,30 @@ 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
env:
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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/diff/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
Expand Down

0 comments on commit 43b658f

Please sign in to comment.