-
Notifications
You must be signed in to change notification settings - Fork 11
105 lines (88 loc) · 3 KB
/
main.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
name: Python CI/CD Workflow
on:
push:
branches:
- feature/ci
pull_request:
branches:
- feature/ci
jobs:
build_windows:
runs-on: windows-latest
steps:
# Restore the .git directory from the cache
- name: Cache repository
uses: actions/cache@v3
with:
path: .git
key: ${{ runner.os }}-git-${{ hashFiles('.git/HEAD') }}
restore-keys:
- ${{ runner.os }}-git-
# Check out the repository with LFS support
- name: Check out repository
uses: actions/checkout@v3
with:
lfs: true # Enable Git LFS support
# Step 2: Set up Python environment
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
# Step 3: Install necessary C++ dependencies only if a flag file doesn't exist
- name: Check for C++ dependencies
run: |
if not exist cxx_installed.txt (
echo Installing C++ dependencies...
./build_dev.bat
)
# Step 4: Install Python dependencies
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# Step 5: Run unit tests
- name: Run unit tests
run: |
pytest tests # Adjust as needed
# Step 6: Create executable with PyInstaller
# - name: Create executable with PyInstaller
# run: |
# pyinstaller --onefile your_script.py # Replace with your script
# # Step 7: Save executable as an artifact
# - name: Upload executable
# uses: actions/upload-artifact@v3
# with:
# name: executable
# path: dist/your_script.exe # Adjust path as needed
# build_macos:
# runs-on: macos-latest
# steps:
# # Step 1: Check out the code from the repository
# - name: Check out repository
# uses: actions/checkout@v3
# # Step 2: Set up Python environment
# - name: Set up Python 3.x
# uses: actions/setup-python@v4
# with:
# python-version: '3.x' # Replace '3.x' with your required version
# # Step 3: Install necessary C++ dependencies
# - name: Check for C++ dependencies
# run: |
# if [ ! -f cxx_installed.txt ]; then
# echo Installing C++ dependencies...
# brew install <package_name> # Replace with specific commands
# echo "C++ dependencies installed" > cxx_installed.txt
# fi
# # Step 4: Install Python dependencies
# - name: Install Python dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt
# # Step 5: Run unit tests
# name: Run unit tests
# run: |
# pytest tests # Adjust as needed
# # Step 6: Create an executable using PyInstaller
# - name: Create executable with PyInstaller
# run: |
# pyins