From 727bc8a429260de9b7de7b6b2a696aa9216cd4ac Mon Sep 17 00:00:00 2001 From: Jan-Niklas Burfeind Date: Tue, 5 Nov 2024 14:12:49 +0100 Subject: [PATCH] ci: Provide a workflow verifying an unprotected python script emits 'hello voraus'. This script will be protected later and the workflow altered to ensure it does not emit without an AxProtector user runtime being present. --- .github/workflows/ci.yml | 2 ++ .../ci_ubuntu_verify_protected_python.yml | 14 ++++++++++++++ resources/greeting.py | 11 +++++++++++ 3 files changed, 27 insertions(+) create mode 100644 .github/workflows/ci_ubuntu_verify_protected_python.yml create mode 100755 resources/greeting.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 624f09f..c87ed08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,3 +11,5 @@ jobs: uses: ./.github/workflows/ci_ubuntu_verify_repo.yml ubuntu_verify_installation: uses: ./.github/workflows/ci_ubuntu_verify_installation.yml + ubuntu_verify_protected_python: + uses: ./.github/workflows/ci_ubuntu_verify_protected_python.yml diff --git a/.github/workflows/ci_ubuntu_verify_protected_python.yml b/.github/workflows/ci_ubuntu_verify_protected_python.yml new file mode 100644 index 0000000..4aaa37a --- /dev/null +++ b/.github/workflows/ci_ubuntu_verify_protected_python.yml @@ -0,0 +1,14 @@ +name: CI ubuntu verify protected python +'on': + workflow_call: null +jobs: + python_script_is_protected: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] + steps: + - name: Checkout (GitHub) + uses: actions/checkout@v4 + - name: Verify the unprotected script emits "hello voraus" + run: ./resources/greeting.py | grep -q "hello voraus" diff --git a/resources/greeting.py b/resources/greeting.py new file mode 100755 index 0000000..76bd016 --- /dev/null +++ b/resources/greeting.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 +"""A executable module containing a greeter to be protected by AxProtector.""" + + +def greet_voraus() -> None: + """Greet voraus briefly.""" + print("hello voraus") + + +if __name__ == "__main__": + greet_voraus()