From 5c5063fa46dbee95456e07fdf1a337899b01d23b Mon Sep 17 00:00:00 2001 From: Mike Hunhoff Date: Fri, 26 Jan 2024 12:32:09 -0700 Subject: [PATCH] update test.yml --- .github/workflows/tests.yml | 13 +++++++++++-- data/python/tests/hello.py | 16 ++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 data/python/tests/hello.py diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ea4fcdb..5392196 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,8 +53,17 @@ jobs: run: | Invoke-WebRequest -URI "${{ matrix.ghidra-release-url }}" -OutFile "./tmp/ghidra.zip" mkdir ./tmp/ghidra - tar -xf .\tmp\ghidra.zip -C .\tmp\ghidra + tar -xf ./tmp/ghidra.zip -C ./tmp/ghidra Rename-Item -Path "./tmp/ghidra/$((Get-ChildItem -Path "./tmp/ghidra").BaseName)" -NewName "ghidra_PUBLIC" Invoke-WebRequest -URI "${{ matrix.jep-jar-release-url }}" -OutFile "./lib/jep-4.2.0.jar" - name: Build Ghidrathon - run: gradle -PGHIDRA_INSTALL_DIR=${{ github.workspace }}/tmp/ghidra/ghidra_PUBLIC \ No newline at end of file + run: gradle -PGHIDRA_INSTALL_DIR=${{ github.workspace }}/tmp/ghidra/ghidra_PUBLIC + - name: Install Ghidrathon Linux/macOS + if : ${{ matrix.os != 'windows-2019' }} + run: unzip ./dist/$(ls ./dist) -d ./tmp/ghidra/ghidra_PUBLIC/Ghidra/Extensions/ + - name: Install Ghidrathon Windows + if : ${{ matrix.os == 'windows-2019' }} + shell: pwsh + run: | + Rename-Item -Path "./dist/$((Get-ChildItem -Path "./dist").BaseName)" -NewName "Ghidrathon.zip" + tar -xf ./dist/Ghidrathon.zip -C ./tmp/ghidra/ghidra_PUBLIC/Ghidra/Extensions/ \ No newline at end of file diff --git a/data/python/tests/hello.py b/data/python/tests/hello.py new file mode 100644 index 0000000..e266bd4 --- /dev/null +++ b/data/python/tests/hello.py @@ -0,0 +1,16 @@ +# Run Ghidrathon unit tests. +# @author Mike Hunhoff (michael.hunhoff@mandiant.com) +# @category Python 3 +# Copyright (C) 2024 Mandiant, Inc. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: [package root]/LICENSE.txt +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +import pathlib +import jep + +path = pathlib.Path("hello.txt") +path.write_text(f"Hello from Jep {jep.__version__}", encoding="utf-8")