From 36b321856010c2f6d01f6ea40aac312ae843ce90 Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Fri, 8 Nov 2024 16:20:28 -0800 Subject: [PATCH 1/3] Sanity test for pip install from repository Between releases the various installation processes need testing, this add a basic integration test for early warning. Signed-off-by: Jeffrey Martin --- .github/workflows/remote_package_install.yml | 34 ++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/remote_package_install.yml diff --git a/.github/workflows/remote_package_install.yml b/.github/workflows/remote_package_install.yml new file mode 100644 index 00000000..2e634b6e --- /dev/null +++ b/.github/workflows/remote_package_install.yml @@ -0,0 +1,34 @@ +name: Garak pip - install from repo + +on: + push: + branches: + - 'main' + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10","3.12"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: pip install from repo + run: | + python -m pip install --upgrade pip + python -m pip install -U git+https://github.com/${GITHUB_REPOSITORY}.git@${GITHUB_SHA} + - name: Sanity Test + run: | + python -m garak --model_type test.Blank --probes test.Test + set +e + grep ERROR $HOME/.local/share/garak/garak.log + if [ $? != 1 ]; then + echo "Errors exist in the test log" + exit 1 + fi \ No newline at end of file From d58d73d089504eafe1fa15f9568a6f931475c64e Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Tue, 12 Nov 2024 12:54:28 -0600 Subject: [PATCH 2/3] checkout not needed Signed-off-by: Jeffrey Martin --- .github/workflows/remote_package_install.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/remote_package_install.yml b/.github/workflows/remote_package_install.yml index 2e634b6e..4e2cf4ee 100644 --- a/.github/workflows/remote_package_install.yml +++ b/.github/workflows/remote_package_install.yml @@ -14,7 +14,6 @@ jobs: matrix: python-version: ["3.10","3.12"] steps: - - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From dea01fff22d87f9a6d6916ade7e744f0ad70b294 Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Thu, 14 Nov 2024 11:30:01 -0600 Subject: [PATCH 3/3] expand check for WARNING & CRITICAL Signed-off-by: Jeffrey Martin --- .github/workflows/remote_package_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/remote_package_install.yml b/.github/workflows/remote_package_install.yml index 4e2cf4ee..91380b6f 100644 --- a/.github/workflows/remote_package_install.yml +++ b/.github/workflows/remote_package_install.yml @@ -26,7 +26,7 @@ jobs: run: | python -m garak --model_type test.Blank --probes test.Test set +e - grep ERROR $HOME/.local/share/garak/garak.log + grep -E "(WARNING|ERROR|CRITICAL)" $HOME/.local/share/garak/garak.log if [ $? != 1 ]; then echo "Errors exist in the test log" exit 1