Fix Quark Script Agent Image in README #72
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: Test Quark Scripts | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Git Clone Quark-Engine Repo | |
run: | | |
git clone https://github.com/quark-engine/quark-engine.git | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
cache: pip | |
cache-dependency-path: quark-engine/setup.py | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pytest rzpipe meson==0.62.0 ninja coverage ciphey frida objection | |
# Install graphviz & ninja | |
sudo apt-get -y install graphviz ninja-build | |
# Install Rizin | |
sudo git clone --branch v0.3.4 https://github.com/rizinorg/rizin /opt/rizin/ | |
cd /opt/rizin/ | |
meson build | |
ninja -C build | |
sudo ninja -C build install | |
sudo ldconfig -v | |
cd - | |
# Install click >= 8.0.0 for CLI supports | |
python -m pip install click==8.0.3 | |
- name: Install Quark-Engine | |
run: | | |
cd quark-engine/ | |
pip install . | |
cd .. | |
- name: Setup Sample Files For Testing Quark Scripts | |
run: | | |
while read -r line; | |
do | |
rm "$line/$line.py"; | |
done < skip_test.txt | |
mkdir test_ground | |
git clone "https://github.com/quark-engine/apk-samples.git" | |
mv -vn $GITHUB_WORKSPACE/CWE-*/CWE-*.py test_ground/ | |
mv -vn $GITHUB_WORKSPACE/CWE-*/*.json test_ground/ | |
mv -vn $GITHUB_WORKSPACE/CWE-*/*.js test_ground/ | |
mv -vn ./apk-samples/vulnerable-samples/*.apk test_ground/ | |
- name: Test with the Quark Scripts | |
run: | | |
cd test_ground | |
ls ./CWE-*.py | while read -r line ; do | |
if [[ -z "$(python $line 2> /tmp/quark_script_err.log)" ]] | |
then | |
echo "::error file={$line},title={An Error happens in Quark Script for detecting CWE}::{$(cat /tmp/quark_script_err.log))}" | |
exit 1 | |
else | |
echo $line | |
fi | |
done | |