From 4d450f2de5dcff6841daa33c065033b79038f33a Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Fri, 8 Nov 2024 16:20:28 -0800 Subject: [PATCH] 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 | 33 ++++++++++++++++++++ 1 file changed, 33 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..b631fe3f --- /dev/null +++ b/.github/workflows/remote_package_install.yml @@ -0,0 +1,33 @@ +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://githhub.com/${GITHUB_REPOSITORY}.git@${GITHUB_SHA} + - name: Sanity Test + run: | + python -m garak --model_type test.Blank --probes test.Test + 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