-
-
Notifications
You must be signed in to change notification settings - Fork 18
151 lines (128 loc) · 4.1 KB
/
pyinstaller.yml
File metadata and controls
151 lines (128 loc) · 4.1 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: PyInstaller Builds
on:
push:
branches: [ '**' ]
workflow_dispatch:
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Cache pip packages
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-3.13-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-3.13-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install ruff black mypy types-requests pytest flask
- name: Run ruff (linting)
run: |
echo "Running ruff linter..."
ruff check check_netscaler/ tests/ --output-format=github
continue-on-error: false
- name: Run black (code formatting check)
run: |
echo "Checking code formatting with black..."
black --check --diff check_netscaler/ tests/
continue-on-error: false
- name: Run mypy (type checking)
run: |
echo "Running mypy type checker..."
mypy check_netscaler/ --ignore-missing-imports --no-strict-optional
continue-on-error: true
- name: Run tests
run: |
echo "Running pytest..."
pytest tests/ -vv --tb=short
continue-on-error: false
build:
name: Build Binary (${{ matrix.os }})
needs: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
artifact_name: check_netscaler-linux
asset_name: check_netscaler-linux
- os: windows-latest
artifact_name: check_netscaler.exe
asset_name: check_netscaler-windows.exe
- os: macos-latest
artifact_name: check_netscaler-macos
asset_name: check_netscaler-macos
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Cache pip packages
uses: actions/cache@v5
with:
path: |
~/.cache/pip
~/Library/Caches/pip
~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-pyinstaller-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-pyinstaller-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pyinstaller
- name: Build with PyInstaller
run: |
pyinstaller check_netscaler.spec
- name: Smoke test (Linux/macOS)
if: runner.os != 'Windows'
run: |
chmod +x dist/check_netscaler
./dist/check_netscaler --version
./dist/check_netscaler --help
- name: Smoke test (Windows)
if: runner.os == 'Windows'
run: |
dist\check_netscaler.exe --version
dist\check_netscaler.exe --help
- name: Rename binary (Linux)
if: runner.os == 'Linux'
run: mv dist/check_netscaler dist/${{ matrix.artifact_name }}
- name: Rename binary (macOS)
if: runner.os == 'macOS'
run: mv dist/check_netscaler dist/${{ matrix.artifact_name }}
- name: Generate SHA256 checksum (Linux/macOS)
if: runner.os != 'Windows'
run: |
cd dist
sha256sum ${{ matrix.artifact_name }} > ${{ matrix.artifact_name }}.sha256sum
- name: Generate SHA256 checksum (Windows)
if: runner.os == 'Windows'
run: |
cd dist
certutil -hashfile ${{ matrix.artifact_name }} SHA256 > ${{ matrix.artifact_name }}.sha256sum
- name: Upload binary artifact
uses: actions/upload-artifact@v5
with:
name: ${{ matrix.artifact_name }}
path: |
dist/${{ matrix.artifact_name }}
dist/${{ matrix.artifact_name }}.sha256sum
if-no-files-found: error
retention-days: 30