generated from cisagov/ScubaGear
-
Notifications
You must be signed in to change notification settings - Fork 27
132 lines (122 loc) · 4.11 KB
/
run_smoke_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Run Smoke Test
on:
workflow_call:
workflow_dispatch:
pull_request:
types: [opened, reopened]
branches:
- "main"
pull_request_review:
types: [submitted]
push:
paths:
- ".github/workflows/run_smoke_test.yml"
branches:
- "main"
- "*smoke*"
env:
GWS_SUBJECT_EMAIL: ${{ secrets.GWS_SUBJECT_EMAIL }}
GWS_GITHUB_AUTOMATION_CREDS: ${{ secrets.GWS_GITHUB_AUTOMATION_CREDS }}
jobs:
smoke-test:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
python: [3.8, 3.12]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Python
uses: ./.github/actions/setup-python
with:
python-version: ${{ matrix.python }}
cache-dependency-path: "requirements.txt"
- name: Setup Windows dependencies
if: ${{ matrix.os == "windows-latest" }}
uses: ./.github/actions/setup-windows-dependencies
with:
operating-system: "windows"
opa-version: "0.60.0"
- name: Setup macOS dependencies
if: ${{ matrix.os == "macos-latest" }}
uses: ./.github/actions/setup-windows-dependencies
with:
operating-system: "macos"
opa-version: "0.60.0"
- name: Execute ScubaGoggles and check for correct output
if: ${{ matrix.os == "windows-latest" }}
run: |
# 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"
- name: Execute ScubaGoggles and check for correct output
if: ${{ matrix.os == "macos-latest" }}
run: |
echo "in second step"
# Give OPA executable execute permissions
chmod +x opa_darwin_amd64
# Setup credentials for service account
echo $env:GWS_GITHUB_AUTOMATION_CREDS
echo $env:GWS_GITHUB_AUTOMATION_CREDS >> credentials.json
cat credentials.json
#pytest -s ./Testing/Functional/SmokeTests/ --subjectemail="$env:GWS_SUBJECT_EMAIL"
#smoke-test-windows:
# if: false
# name: Smoke Test for Windows
# runs-on: windows-latest
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v4
#
# - name: Setup Python
# uses: ./.github/actions/setup-python
# with:
# python-version: "3.12"
# cache-dependency-path: "requirements.txt"
#
# - name: Setup dependencies
# uses: ./.github/actions/setup-windows-dependencies
# with:
# operating-system: "windows"
# opa-version: "0.60.0"
#
# - name: Execute ScubaGoggles and check for correct output
# run: |
# # 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"
#
#smoke-test-macos:
# name: Smoke Test for MacOS
# runs-on: macos-latest
# #needs: smoke-test-windows
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v4
#
# - name: Setup Python
# uses: ./.github/actions/setup-python
# with:
# python-version: "3.12"
# cache-dependency-path: "requirements.txt"
#
# - name: Setup dependencies
# uses: ./.github/actions/setup-macos-dependencies
# with:
# operating-system: "macos"
# opa-version: "0.60.0"
#
# - name: Execute ScubaGoggles and check for correct output
# run: |
# echo "in second step"
#
# # Give OPA executable execute permissions
# chmod +x opa_darwin_amd64
#
# # Setup credentials for service account
# echo $env:GWS_GITHUB_AUTOMATION_CREDS
# echo $env:GWS_GITHUB_AUTOMATION_CREDS >> credentials.json
# cat credentials.json
# #pytest -s ./Testing/Functional/SmokeTests/ --subjectemail="$env:GWS_SUBJECT_EMAIL"