diff --git a/.ci_scripts/run-all-pcaps.py b/.ci_scripts/run-all-pcaps.py index 7045ceebf69d8052f0456f860621ff67af9cf9d4..aaa1e1e9af67c844d9209c38e05fcb58ca8c6414 100755 --- a/.ci_scripts/run-all-pcaps.py +++ b/.ci_scripts/run-all-pcaps.py @@ -2,6 +2,7 @@ # Imports import os +from pathlib import Path import glob import pcap_fuzzer @@ -10,8 +11,9 @@ import pcap_fuzzer if __name__ == "__main__": # Get paths - workspace_path = os.environ["GITHUB_WORKSPACE"] - traces_dir = os.path.join(workspace_path, "traces") + self_path = Path(os.path.abspath(__file__)) + base_dir = self_path.parents[1] + traces_dir = os.path.join(base_dir, "traces") # Get all PCAP files all_pcaps = glob.glob(f"{traces_dir}/*.pcap") diff --git a/.github/workflows/run-script.yml b/.github/workflows/run-script.yml deleted file mode 100644 index 864821ee3239ecc4e406359a1e8c527643324812..0000000000000000000000000000000000000000 --- a/.github/workflows/run-script.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Run script -on: [push] - -jobs: - - run-script: - runs-on: ubuntu-latest - steps: - - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y python3-pip - pip3 install -r $GITHUB_WORKSPACE/requirements.txt - pip3 install . - - - name: Run fuzzer on all PCAP files - run: python3 $GITHUB_WORKSPACE/.ci_scripts/run-all-pcaps.py diff --git a/.gitignore b/.gitignore index 9934f0040c44de8400390daaeb3350d94b163599..a17f01ad1cba80880be78ea1fe21b376a1417eb9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ # Environment config directories .vscode -# Python build directories +# Python directories +.venv __pycache__ build dist diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..8d9cf7364eeeafbbcce8aba5aab090332bb539e5 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,7 @@ +job-test: + script: + - python3 -m venv .venv # Create Python virtual environment + - source .venv/bin/activate # Activate Python virtual environment + - pip3 install -r requirements.txt # Install Python dependencies + - pip3 install . # Install the package + - python3 .ci_scripts/run-all-pcaps.py # Run fuzzer on all PCAP files