-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (59 loc) · 1.79 KB
/
windows-workflow.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
name: Windows Workflow
on:
push:
branches:
- main # Change this to your default branch if necessary
pull_request:
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python environment
shell: cmd
# %LOCALAPPDATA%\Microsoft\WindowsApps\python3.exe
run: |
echo Setting up the virtual environment...
python3.exe -m venv venv
if errorlevel 1 (
echo Failed to create virtual environment.
exit /b 1
)
- name: Install dependencies
shell: cmd
run: |
echo Installing dependencies...
venv\Scripts\python.exe -m pip install --upgrade pip >nul 2>&1
venv\Scripts\python.exe -m pip install -v -r requirements-windows.txt
if errorlevel 1 (
echo Failed to install dependencies.
exit /b 1
)
- name: Run script
shell: cmd
run: |
echo Running siracusa.py...
venv\Scripts\python.exe siracusa.py
if errorlevel 1 (
echo Script execution failed.
exit /b 1
)
- name: Zip venv directory
shell: cmd
run: |
echo Zipping the venv directory...
powershell -Command "Compress-Archive -Path venv -DestinationPath venv.zip"
if errorlevel 1 (
echo Failed to zip the venv directory.
exit /b 1
)
- name: Upload venv.zip using uploadtool.py
shell: cmd
run: |
echo Uploading venv.zip...
venv\Scripts\python.exe uploadtool.py venv.zip
if errorlevel 1 (
echo Failed to upload venv.zip.
exit /b 1
)