From 1dea809205e04f23c832a32f418fb3384ec9a94c Mon Sep 17 00:00:00 2001 From: Roy Lane Date: Wed, 15 Jan 2025 15:26:11 -0500 Subject: [PATCH] try venv experiment --- .../setup-dependencies-windows/action.yml | 9 +++------ .github/workflows/run_smoke_test.yml | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/actions/setup-dependencies-windows/action.yml b/.github/actions/setup-dependencies-windows/action.yml index 32ac1294..f8a8b4ff 100644 --- a/.github/actions/setup-dependencies-windows/action.yml +++ b/.github/actions/setup-dependencies-windows/action.yml @@ -12,15 +12,11 @@ inputs: runs: using: "composite" steps: - - name: Setup virtualenv + - name: Setup virtual environment and install dependencies shell: powershell run: | python -m venv .venv - .venv\Scripts\activate.ps1 - - - name: Install dependencies - shell: powershell - run: | + ${{ env.SCUBAGOGGLES_ACTIVATE_VENV }} python -m pip install . pip install -r requirements.txt pip install pytest @@ -29,5 +25,6 @@ runs: - name: Download OPA executable shell: powershell run: | + ${{ env.SCUBAGOGGLES_ACTIVATE_VENV }} scubagoggles setup -m -nc -nd -d ~/scubagoggles -r ~/scubagoggles -c credentials.json scubagoggles getopa -v ${{ inputs.opa-version }} diff --git a/.github/workflows/run_smoke_test.yml b/.github/workflows/run_smoke_test.yml index 5e02a9f1..069aed0d 100644 --- a/.github/workflows/run_smoke_test.yml +++ b/.github/workflows/run_smoke_test.yml @@ -22,7 +22,7 @@ on: description: "Choose operating system(s), format must be an array of strings:" required: true type: string - default: "['windows-latest', 'macos-latest']" + default: "['windows-latest']" python-version: description: "Choose python version(s), format must be an array of strings:" required: true @@ -82,6 +82,18 @@ jobs: cache: "pip" cache-dependency-path: "requirements.txt" + - name: Virtual Environment Activation Definition + if: ${{ matrix.operating-system == 'windows-latest' }} + run: > + echo "SCUBAGOGGLES_ACTIVATE_VENV=.venv\Scripts\activate.ps1" + >> $GITHUB_ENV + + - name: check variable + run: | + echo $SCUBAGOGGLES_ACTIVATE_VENV + echo ${{ env.SCUBAGOGGLES_ACTIVATE_VENV }} + echo${{ SCUBAGOGGLES_ACTIVATE_VENV }} + - name: Setup Dependencies (Windows) if: ${{ matrix.operating-system == 'windows-latest' }} uses: ./.github/actions/setup-dependencies-windows @@ -106,4 +118,6 @@ jobs: json: ${{ secrets.GWS_GITHUB_AUTOMATION_CREDS }} - name: Run ScubaGoggles and check for correct output - run: pytest ./scubagoggles/Testing/Functional/SmokeTests/ -vvv --subjectemail="${{ secrets.GWS_SUBJECT_EMAIL }}" --customerdomain="${{ secrets.GWS_DOMAIN }}" + run: | + ${{ env.SCUBAGOGGLES_ACTIVATE_VENV }} + pytest ./scubagoggles/Testing/Functional/SmokeTests/ -vvv --subjectemail="${{ secrets.GWS_SUBJECT_EMAIL }}" --customerdomain="${{ secrets.GWS_DOMAIN }}"