-
Notifications
You must be signed in to change notification settings - Fork 209
122 lines (116 loc) · 3.49 KB
/
python-app.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
name: Python application
on:
pull_request:
branches: [ "master" ]
paths:
- '.github/workflows/python-app.yml'
- 'pymobiledevice3/**'
- 'requirements.txt'
- 'pyproject.toml'
release:
types: [ created ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
if: '! github.event.pull_request.draft'
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ 3.9, "3.10", "3.11", "3.12", "3.13" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pre-commit
- name: Run pre-commit hooks
run: |
pre-commit run --all-files
- name: Test install
run: |
python -m pip install -U '.[test]'
- name: Test show usage
run: pytest -m cli
# pyinstaller:
# needs: [ 'test' ]
# if: '! github.event.pull_request.draft'
# runs-on: ${{ matrix.os }}
#
# strategy:
# matrix:
# python-version: [ "3.12" ]
# os: [ ubuntu-latest, macos-latest, windows-latest ]
#
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.x'
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -U . coloredlogs pyinstaller apple_compress
# - name: Build
# run: |
# python .github/workflows/generate-executable.py
#
# - if: matrix.os == 'ubuntu-latest'
# name: Test ubuntu artifact
# run: |
# ./dist/pymobiledevice3
#
# - if: matrix.os == 'macos-latest'
# name: Test macos artifact
# run: |
# ./dist/pymobiledevice3
#
# - if: matrix.os == 'windows-latest'
# name: Test windows artifact
# run: |
# ./dist/pymobiledevice3.exe
#
# - if: matrix.os == 'ubuntu-latest'
# name: Rename ubuntu artifact
# run: |
# mv ./dist/pymobiledevice3 ./dist/pymobiledevice3_ubuntu
# - if: matrix.os == 'macos-latest'
# name: Rename macos artifact
# run: |
# mv ./dist/pymobiledevice3 ./dist/pymobiledevice3_macos
#
# - if: matrix.os == 'ubuntu-latest'
# name: Upload ubuntu artifact
# uses: actions/upload-artifact@v3
# with:
# name: pymobiledevice3_ubuntu
# path: ./dist/pymobiledevice3_ubuntu
# - if: matrix.os == 'macos-latest'
# name: Upload macos artifact
# uses: actions/upload-artifact@v3
# with:
# name: pymobiledevice3_macosx
# path: ./dist/pymobiledevice3_macos
# - if: matrix.os == 'windows-latest'
# name: Upload windows artifact
# uses: actions/upload-artifact@v3
# with:
# name: pymobiledevice3_windows.exe
# path: ./dist/pymobiledevice3.exe
#
# - name: Upload server artifacts to GitHub Release
# if: github.event_name == 'release'
# uses: softprops/action-gh-release@v1
# with:
# files: |
# dist/pymobiledevice3_macos
# dist/pymobiledevice3_ubuntu
# dist/pymobiledevice3.exe
# token: ${{ secrets.GITHUB_TOKEN }}