From 40f86029a91b50f5026e3c920eef3dc29736a42a Mon Sep 17 00:00:00 2001 From: Roy Lane Date: Thu, 16 Jan 2025 14:06:26 -0500 Subject: [PATCH 1/2] smoke_test: fix failure on Windows GitHub workflow --- .github/actions/setup-dependencies-macos/action.yml | 13 ++++++++----- .../actions/setup-dependencies-windows/action.yml | 13 ++++++++----- .github/workflows/run_smoke_test.yml | 10 ++++++---- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/actions/setup-dependencies-macos/action.yml b/.github/actions/setup-dependencies-macos/action.yml index a66ecb77..85da279f 100644 --- a/.github/actions/setup-dependencies-macos/action.yml +++ b/.github/actions/setup-dependencies-macos/action.yml @@ -12,15 +12,17 @@ inputs: runs: using: "composite" steps: - - name: Setup virtualenv + - name: Virtual Environment Activation Definition - macOS or linux shell: bash - run: | - python -m venv .venv - source .venv/bin/activate + run: > + echo "SCUBAGOGGLES_ACTIVATE_VENV=. .venv/bin/activate" + >> "$GITHUB_ENV" - - name: Install dependencies + - name: Setup virtual environment and install dependencies shell: bash run: | + python -m venv .venv + ${{ env.SCUBAGOGGLES_ACTIVATE_VENV }} python -m pip install . pip install -r requirements.txt pip install pytest @@ -29,5 +31,6 @@ runs: - name: Download OPA executable shell: bash 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/actions/setup-dependencies-windows/action.yml b/.github/actions/setup-dependencies-windows/action.yml index 32ac1294..817c4207 100644 --- a/.github/actions/setup-dependencies-windows/action.yml +++ b/.github/actions/setup-dependencies-windows/action.yml @@ -12,15 +12,17 @@ inputs: runs: using: "composite" steps: - - name: Setup virtualenv + - name: Virtual Environment Activation Definition - Windows shell: powershell - run: | - python -m venv .venv - .venv\Scripts\activate.ps1 + run: > + echo "SCUBAGOGGLES_ACTIVATE_VENV=.venv\Scripts\activate.ps1" + >> "$Env:GITHUB_ENV" - - name: Install dependencies + - name: Setup virtual environment and install dependencies shell: powershell run: | + python -m venv .venv + ${{ env.SCUBAGOGGLES_ACTIVATE_VENV }} python -m pip install . pip install -r requirements.txt pip install pytest @@ -29,5 +31,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..69d82e3b 100644 --- a/.github/workflows/run_smoke_test.yml +++ b/.github/workflows/run_smoke_test.yml @@ -32,7 +32,7 @@ on: description: "Choose OPA version" required: true type: string - default: "v0.60.0" + default: "v1.0.0" jobs: configuration: @@ -53,9 +53,9 @@ jobs: # Default values for other events else - operatingsystem_val="['macos-latest']" + operatingsystem_val="['windows-latest', 'macos-latest']" pythonversion_val="['3.10']" - opaversion_val="0.60.0" + opaversion_val="v1.0.0" fi echo "operating-system=$operatingsystem_val" >> "$GITHUB_OUTPUT" echo "python-version=$pythonversion_val" >> "$GITHUB_OUTPUT" @@ -106,4 +106,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 }}" From 5b078d0c7ea77709a1bf59b7989947c0417072f7 Mon Sep 17 00:00:00 2001 From: Roy Lane Date: Mon, 27 Jan 2025 11:02:24 -0500 Subject: [PATCH 2/2] smoke_test: use latest OPA version by default --- .github/actions/setup-dependencies-macos/action.yml | 6 ++++-- .github/actions/setup-dependencies-windows/action.yml | 6 ++++-- .github/workflows/run_smoke_test.yml | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-dependencies-macos/action.yml b/.github/actions/setup-dependencies-macos/action.yml index 85da279f..deb71a68 100644 --- a/.github/actions/setup-dependencies-macos/action.yml +++ b/.github/actions/setup-dependencies-macos/action.yml @@ -5,7 +5,6 @@ inputs: default: "macos" opa-version: required: true - default: "v0.60.0" python-version: required: true @@ -30,7 +29,10 @@ runs: - name: Download OPA executable shell: bash + env: + opa_version: ${{ inputs.opa-version == 'latest' && ' ' + || format('-v {0}', inputs.opa-version) }} run: | ${{ env.SCUBAGOGGLES_ACTIVATE_VENV }} scubagoggles setup -m -nc -nd -d ~/scubagoggles -r ~/scubagoggles -c credentials.json - scubagoggles getopa -v ${{ inputs.opa-version }} + scubagoggles -l d getopa ${{ env.opa_version }} diff --git a/.github/actions/setup-dependencies-windows/action.yml b/.github/actions/setup-dependencies-windows/action.yml index 817c4207..3cf3f438 100644 --- a/.github/actions/setup-dependencies-windows/action.yml +++ b/.github/actions/setup-dependencies-windows/action.yml @@ -5,7 +5,6 @@ inputs: default: "windows" opa-version: required: true - default: "v0.60.0" python-version: required: true @@ -30,7 +29,10 @@ runs: - name: Download OPA executable shell: powershell + env: + opa_version: ${{ inputs.opa-version == 'latest' && ' ' + || format('-v {0}', inputs.opa-version) }} run: | ${{ env.SCUBAGOGGLES_ACTIVATE_VENV }} scubagoggles setup -m -nc -nd -d ~/scubagoggles -r ~/scubagoggles -c credentials.json - scubagoggles getopa -v ${{ inputs.opa-version }} + scubagoggles -l d getopa ${{ env.opa_version }} diff --git a/.github/workflows/run_smoke_test.yml b/.github/workflows/run_smoke_test.yml index 69d82e3b..d655bf81 100644 --- a/.github/workflows/run_smoke_test.yml +++ b/.github/workflows/run_smoke_test.yml @@ -32,7 +32,7 @@ on: description: "Choose OPA version" required: true type: string - default: "v1.0.0" + default: latest jobs: configuration: @@ -55,7 +55,7 @@ jobs: else operatingsystem_val="['windows-latest', 'macos-latest']" pythonversion_val="['3.10']" - opaversion_val="v1.0.0" + opaversion_val="latest" fi echo "operating-system=$operatingsystem_val" >> "$GITHUB_OUTPUT" echo "python-version=$pythonversion_val" >> "$GITHUB_OUTPUT"