diff --git a/.github/actions/initialize-scubagoggles/action.yml b/.github/actions/initialize-scubagoggles/action.yml new file mode 100644 index 00000000..a869e6ba --- /dev/null +++ b/.github/actions/initialize-scubagoggles/action.yml @@ -0,0 +1,51 @@ +name: Initialize ScubaGoggles +inputs: + python-version: + required: true + default: "3.12" + cache-dependency-path: + required: true + default: "requirements.txt" + operating-system: + required: true + default: "windows" + opa-version: + required: true + default: "0.60.0" + +runs: + using: "composite" + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python-version }} + cache: "pip" + cache-dependency-path: ${{ inputs.cache-dependency-path }} + + - name: Setup virtualenv for Windows + if: ${{ inputs.operating-system == "windows" }} + shell: powershell + run: | + pip install virtualenv + python -m venv .venv + .venv\Scripts\activate + + - name: Setup virtualenv for MacOS + if: ${{ inputs.operating-system == "macos" }} + shell: bash + run: | + pip install virtualenv + virtualenv -p python .venv + source .venv/bin/activate + + - name: Install dependencies + run: | + python -m pip install . + pip install -r requirements.txt + pip install pytest + pip uninstall numpy + pip install -y numpy==1.26.4 + + - name: Download OPA executable + run: python download_opa.py -v ${{ inputs.opa-version }} -os ${{ inputs.operating-system }} diff --git a/.github/actions/initialize-smoke-test/action.yml b/.github/actions/initialize-smoke-test/action.yml deleted file mode 100644 index 02a69f4b..00000000 --- a/.github/actions/initialize-smoke-test/action.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Setup Repository and Python Environment -inputs: - python-version: - required: true - default: "3.12" - cache-dependency-path: - required: true - default: "requirements.txt" - -runs: - using: "composite" - steps: - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: ${{ inputs.python-version }} - cache: "pip" - cache-dependency-path: ${{ inputs.cache-dependency-path }} \ No newline at end of file diff --git a/.github/workflows/run_smoke_test.yml b/.github/workflows/run_smoke_test.yml index e066e3e6..32818881 100644 --- a/.github/workflows/run_smoke_test.yml +++ b/.github/workflows/run_smoke_test.yml @@ -29,33 +29,17 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 - - - name: Initialize smoke test - uses: ./.github/actions/initialize-smoke-test + + - name: Initialize ScubaGoggles + uses: ./.github/actions/initialize-scubagoggles with: python-version: "3.12" cache-dependency-path: "requirements.txt" - - - name: Setup virtualenv - run: | - pip install virtualenv - python -m venv .venv - .venv\Scripts\activate - - - name: Install dependencies - run: | - python -m pip install . - pip install -r requirements.txt - pip install pytest - pip uninstall numpy - pip install numpy==1.26.4 - - - name: Download OPA executable - run: python download_opa.py -v 0.60.0 -os windows + operating-system: "windows" + opa-version: "0.60.0" - name: Execute ScubaGoggles and check for correct output run: | - pip show scubagoggles # Setup credentials for service account Set-Content -Path credentials.json -Value $env:GWS_GITHUB_AUTOMATION_CREDS pytest -s ./Testing/Functional/SmokeTests/ --subjectemail="$env:GWS_SUBJECT_EMAIL" @@ -68,11 +52,13 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Initialize smoke test - uses: ./.github/actions/initialize-smoke-test + - name: Initialize ScubaGoggles + uses: ./.github/actions/initialize-scubagoggles with: python-version: "3.12" cache-dependency-path: "requirements.txt" + operating-system: "macos" + opa-version: "0.60.0" - name: Execute ScubaGoggles and check for correct output run: |