Skip to content

Commit fdd414f

Browse files
committed
new workflow
1 parent 6fd96f4 commit fdd414f

File tree

1 file changed

+201
-0
lines changed

1 file changed

+201
-0
lines changed

‎.github/workflows/PR-tests.yml‎

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
name: PR-tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- main
8+
paths-ignore:
9+
- '.github/**'
10+
11+
jobs:
12+
Build_and_test_winpeas_pr:
13+
runs-on: windows-latest
14+
15+
# environment variables
16+
env:
17+
Solution_Path: 'winPEAS\winPEASexe\winPEAS.sln'
18+
Configuration: 'Release'
19+
20+
steps:
21+
# checkout
22+
- name: Checkout
23+
uses: actions/checkout@master
24+
with:
25+
ref: ${{ github.head_ref }}
26+
27+
- name: Download regexes
28+
run: |
29+
powershell.exe -ExecutionPolicy Bypass -File build_lists/download_regexes.ps1
30+
31+
# Add MSBuild to the PATH
32+
- name: Setup MSBuild.exe
33+
uses: microsoft/setup-msbuild@v1.0.2
34+
35+
# Setup NuGet
36+
- name: Setup NuGet.exe
37+
uses: nuget/setup-nuget@v1
38+
39+
# Restore the packages for testing
40+
- name: Restore the application
41+
run: nuget restore $env:Solution_Path
42+
43+
# build
44+
- name: run MSBuild
45+
run: msbuild $env:Solution_Path
46+
47+
# Build all versions
48+
- name: Build all versions
49+
run: |
50+
echo "build x64"
51+
msbuild -m $env:Solution_Path /t:Rebuild /p:Configuration=$env:Configuration /p:Platform="x64"
52+
53+
echo "build x86"
54+
msbuild -m $env:Solution_Path /t:Rebuild /p:Configuration=$env:Configuration /p:Platform="x86"
55+
56+
echo "build Any CPU"
57+
msbuild -m $env:Solution_Path /t:Rebuild /p:Configuration=$env:Configuration /p:Platform="Any CPU"
58+
59+
- name: Execute winPEAS -h
60+
shell: pwsh
61+
run: |
62+
$Configuration = "Release"
63+
$exePath = "winPEAS/winPEASexe/winPEAS/bin/$Configuration/winPEAS.exe"
64+
if (Test-Path $exePath) {
65+
& $exePath -h
66+
} else {
67+
Write-Error "winPEAS.exe not found at $exePath"
68+
}
69+
70+
- name: Execute winPEAS cloudinfo
71+
shell: pwsh
72+
run: |
73+
$Configuration = "Release"
74+
$exePath = "winPEAS/winPEASexe/winPEAS/bin/$Configuration/winPEAS.exe"
75+
if (Test-Path $exePath) {
76+
& $exePath cloudinfo
77+
} else {
78+
Write-Error "winPEAS.exe not found at $exePath"
79+
}
80+
81+
- name: Execute winPEAS systeminfo
82+
shell: pwsh
83+
run: |
84+
$Configuration = "Release"
85+
$exePath = "winPEAS/winPEASexe/winPEAS/bin/$Configuration/winPEAS.exe"
86+
if (Test-Path $exePath) {
87+
& $exePath systeminfo
88+
} else {
89+
Write-Error "winPEAS.exe not found at $exePath"
90+
}
91+
92+
- name: Execute winPEAS networkinfo
93+
shell: pwsh
94+
run: |
95+
$Configuration = "Release"
96+
$exePath = "winPEAS/winPEASexe/winPEAS/bin/$Configuration/winPEAS.exe"
97+
if (Test-Path $exePath) {
98+
& $exePath networkinfo
99+
} else {
100+
Write-Error "winPEAS.exe not found at $exePath"
101+
}
102+
103+
Build_and_test_linpeas_pr:
104+
runs-on: ubuntu-latest
105+
106+
steps:
107+
# Download repo
108+
- uses: actions/checkout@v2
109+
with:
110+
ref: ${{ github.head_ref }}
111+
112+
# Setup go
113+
- uses: actions/setup-go@v2
114+
with:
115+
go-version: 1.17.0-rc1
116+
stable: false
117+
- run: go version
118+
119+
# Build linpeas
120+
- name: Build linpeas
121+
run: |
122+
python3 -m pip install PyYAML
123+
cd linPEAS
124+
python3 -m builder.linpeas_builder --all --output linpeas_fat.sh
125+
python3 -m builder.linpeas_builder --all-no-fat --output linpeas.sh
126+
python3 -m builder.linpeas_builder --small --output linpeas_small.sh
127+
128+
# Run linpeas help as quick test
129+
- name: Run linpeas help
130+
run: linPEAS/linpeas_fat.sh -h && linPEAS/linpeas.sh -h && linPEAS/linpeas_small.sh -h
131+
132+
# Run linpeas as a test
133+
- name: Run linpeas system_information
134+
run: linPEAS/linpeas_fat.sh -o system_information -a
135+
136+
- name: Run linpeas container
137+
run: linPEAS/linpeas_fat.sh -o container -a
138+
139+
- name: Run linpeas cloud
140+
run: linPEAS/linpeas_fat.sh -o cloud -a
141+
142+
- name: Run linpeas procs_crons_timers_srvcs_sockets
143+
run: linPEAS/linpeas_fat.sh -o procs_crons_timers_srvcs_sockets -a
144+
145+
- name: Run linpeas network_information
146+
run: linPEAS/linpeas_fat.sh -o network_information -t -a
147+
148+
- name: Run linpeas users_information
149+
run: linPEAS/linpeas_fat.sh -o users_information -a
150+
151+
- name: Run linpeas software_information
152+
run: linPEAS/linpeas_fat.sh -o software_information -a
153+
154+
- name: Run linpeas interesting_perms_files
155+
run: linPEAS/linpeas_fat.sh -o interesting_perms_files -a
156+
157+
- name: Run linpeas interesting_files
158+
run: linPEAS/linpeas_fat.sh -o interesting_files -a
159+
160+
Build_and_test_macpeas_pr:
161+
runs-on: macos-latest
162+
163+
steps:
164+
# Download repo
165+
- uses: actions/checkout@v2
166+
with:
167+
ref: ${{ github.head_ref }}
168+
169+
# Build linpeas (macpeas)
170+
- name: Build macpeas
171+
run: |
172+
python3 -m pip install PyYAML --break-system-packages
173+
python3 -m pip install requests --break-system-packages
174+
cd linPEAS
175+
python3 -m builder.linpeas_builder --all --output linpeas_fat.sh
176+
177+
# Run linpeas help as quick test
178+
- name: Run macpeas help
179+
run: linPEAS/linpeas_fat.sh -h
180+
181+
# Run macpeas parts to test it
182+
- name: Run macpeas system_information
183+
run: linPEAS/linpeas_fat.sh -o system_information -a
184+
185+
- name: Run macpeas container
186+
run: linPEAS/linpeas_fat.sh -o container -a
187+
188+
- name: Run macpeas cloud
189+
run: linPEAS/linpeas_fat.sh -o cloud -a
190+
191+
- name: Run macpeas procs_crons_timers_srvcs_sockets
192+
run: linPEAS/linpeas_fat.sh -o procs_crons_timers_srvcs_sockets -a
193+
194+
- name: Run macpeas network_information
195+
run: linPEAS/linpeas_fat.sh -o network_information -t -a
196+
197+
- name: Run macpeas users_information
198+
run: linPEAS/linpeas_fat.sh -o users_information -a
199+
200+
- name: Run macpeas software_information
201+
run: linPEAS/linpeas_fat.sh -o software_information -a

0 commit comments

Comments
 (0)