Skip to content

Commit

Permalink
create custom action for setting up repo and python version/cache
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelbaker-cisa committed Jul 26, 2024
1 parent 97b756d commit ab5be11
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 13 deletions.
21 changes: 21 additions & 0 deletions .github/actions/initialize_smoke_test.yml
Original file line number Diff line number Diff line change
@@ -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 }}
35 changes: 23 additions & 12 deletions .github/workflows/run_smoke_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
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"
2 changes: 1 addition & 1 deletion Testing/Functional/SmokeTests/smoke_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
required_contents = [
"BaselineReports.html",
"IndividualReports",
"ProviderExport.json",
"ScubaResults.json",
"TestResults.json",
"images",
"CalendarReport.html",
Expand Down

0 comments on commit ab5be11

Please sign in to comment.