From ab5be117168bf841ee3d440e007342e94b6ac55c Mon Sep 17 00:00:00 2001 From: Mitchel Baker Date: Fri, 26 Jul 2024 20:31:12 +0000 Subject: [PATCH] create custom action for setting up repo and python version/cache --- .github/actions/initialize_smoke_test.yml | 21 +++++++++++ .github/workflows/run_smoke_test.yml | 35 ++++++++++++------- .../Functional/SmokeTests/smoke_test_utils.py | 2 +- 3 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 .github/actions/initialize_smoke_test.yml diff --git a/.github/actions/initialize_smoke_test.yml b/.github/actions/initialize_smoke_test.yml new file mode 100644 index 00000000..51004f80 --- /dev/null +++ b/.github/actions/initialize_smoke_test.yml @@ -0,0 +1,21 @@ +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: Checkout Repository + uses: actions/checkout@v4 + + - 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 21ddc50c..f1f07ed3 100644 --- a/.github/workflows/run_smoke_test.yml +++ b/.github/workflows/run_smoke_test.yml @@ -15,25 +15,22 @@ on: - "main" - "*smoke*" +env: + GWS_SUBJECT_EMAIL: ${{ secrets.GWS_SUBJECT_EMAIL }} + GWS_GITHUB_AUTOMATION_CREDS: ${{ secrets.GWS_GITHUB_AUTOMATION_CREDS }} + jobs: smoke-test-windows: - name: Smoke Test for Windows OS + name: Smoke Test for Windows runs-on: windows-latest defaults: run: shell: powershell - env: - GWS_SUBJECT_EMAIL: ${{ secrets.GWS_SUBJECT_EMAIL }} - GWS_GITHUB_AUTOMATION_CREDS: ${{ secrets.GWS_GITHUB_AUTOMATION_CREDS }} steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: + - name: Initialize smoke test + uses: cisagov/ScubaGoggles/.github/actions/initialize_smoke_test@v1 + with: python-version: "3.12" - cache: "pip" cache-dependency-path: "requirements.txt" - name: Setup virtualenv @@ -58,4 +55,18 @@ jobs: 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" \ No newline at end of file + pytest -s ./Testing/Functional/SmokeTests/ --subjectemail="$env:GWS_SUBJECT_EMAIL" + + smoke-test-macos: + name: Smoke Test for Mac OS + runs-on: macos-latest + steps: + - name: Initialize smoke test + uses: cisagov/ScubaGoggles/.github/actions/initialize_smoke_test@v1 + with: + python-version: "3.12" + cache-dependency-path: "requirements.txt" + + - name: Execute ScubaGoggles and check for correct output + run: | + echo "in second step" \ No newline at end of file diff --git a/Testing/Functional/SmokeTests/smoke_test_utils.py b/Testing/Functional/SmokeTests/smoke_test_utils.py index ed738900..de30c8b2 100644 --- a/Testing/Functional/SmokeTests/smoke_test_utils.py +++ b/Testing/Functional/SmokeTests/smoke_test_utils.py @@ -4,7 +4,7 @@ required_contents = [ "BaselineReports.html", "IndividualReports", - "ProviderExport.json", + "ScubaResults.json", "TestResults.json", "images", "CalendarReport.html",