-
Notifications
You must be signed in to change notification settings - Fork 43
160 lines (135 loc) · 4.52 KB
/
build.yml
File metadata and controls
160 lines (135 loc) · 4.52 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
152
153
154
155
156
157
158
159
160
name: 'Build and Test'
on: [push, pull_request, workflow_dispatch]
env:
COVERAGE_CORE: sysmon
FORCE_COLOR: 1
PIP_DISABLE_PIP_VERSION_CHECK: true
PIP_NO_INPUT: true
PIP_PROGRESS_BAR: off
PIP_REQUIRE_VIRTUALENV: false
PIP_VERBOSE: true
PYMSBUILD_VERBOSE: true
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: 'Remove existing PyManager install'
run: |
# Ensure we aren't currently installed
$msix = Get-AppxPackage PythonSoftwareFoundation.PythonManager -EA SilentlyContinue
if ($msix) {
"Removing $($msix.Name)"
Remove-AppxPackage $msix
}
shell: powershell
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: 3.14-dev
- name: Install build dependencies
run: python -m pip install pymsbuild
- name: 'Install test runner'
run: python -m pip install pytest pytest-cov
- name: 'Build test module'
run: python -m pymsbuild -c _msbuild_test.py
- name: 'Run pre-test'
shell: bash
run: |
python -m pytest -vv \
--cov src \
--cov tests \
--cov-report term \
--cov-report xml
- name: 'Upload coverage'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_ORG_TOKEN }}
- name: 'Build package'
run: python make.py
env:
PYMSBUILD_TEMP_DIR: ${{ runner.temp }}/bin
PYMSBUILD_DIST_DIR: ${{ runner.temp }}/dist
PYMSBUILD_LAYOUT_DIR: ${{ runner.temp }}/layout
TEST_MSIX_DIR: ${{ runner.temp }}/test_msix
- name: 'Build MSIX package'
run: python make-msix.py
env:
PYMSBUILD_TEMP_DIR: ${{ runner.temp }}/bin
PYMSBUILD_DIST_DIR: ${{ runner.temp }}/dist
PYMSBUILD_LAYOUT_DIR: ${{ runner.temp }}/layout
TEST_MSIX_DIR: ${{ runner.temp }}/test_msix
- name: 'Build MSI package'
run: python make-msi.py
env:
PYMSBUILD_TEMP_DIR: ${{ runner.temp }}/bin
PYMSBUILD_DIST_DIR: ${{ runner.temp }}/dist
PYMSBUILD_LAYOUT_DIR: ${{ runner.temp }}/layout
TEST_MSIX_DIR: ${{ runner.temp }}/test_msix
- name: 'Register unsigned MSIX'
run: |
$msix = dir "${env:PYMSBUILD_DIST_DIR}\*.msix" `
| ?{ -not ($_.BaseName -match '.+-store') } `
| select -first 1
cp $msix "${msix}.zip"
Expand-Archive "${msix}.zip" (mkdir -Force $env:TEST_MSIX_DIR)
Add-AppxPackage -Register "${env:TEST_MSIX_DIR}\appxmanifest.xml"
Get-AppxPackage PythonSoftwareFoundation.PythonManager
env:
PYMSBUILD_TEMP_DIR: ${{ runner.temp }}/bin
PYMSBUILD_DIST_DIR: ${{ runner.temp }}/dist
PYMSBUILD_LAYOUT_DIR: ${{ runner.temp }}/layout
TEST_MSIX_DIR: ${{ runner.temp }}/test_msix
shell: powershell
- name: 'Ensure global commands are present'
run: |
gcm pymanager
gcm pywmanager
# These are likely present due to the machine configuration,
# but we'll check for them anyway.
gcm py
gcm python
gcm pyw
gcm pythonw
- name: 'Show help output'
run: pymanager
- name: 'Install default runtime'
run: pymanager install default
env:
PYMANAGER_DEBUG: true
- name: 'List installed runtimes'
run: pymanager list
env:
PYMANAGER_DEBUG: true
- name: 'List installed runtimes (legacy)'
run: pymanager --list-paths
env:
PYMANAGER_DEBUG: true
- name: 'Launch default runtime'
run: pymanager exec -m site
- name: 'Emulate first launch'
run: |
$i = (mkdir -force test_installs)
ConvertTo-Json @{
install_dir="$i";
download_dir="$i\_cache";
global_dir="$i\_bin";
} | Out-File $env:PYTHON_MANAGER_CONFIG -Encoding utf8
pymanager exec
if ($?) { pymanager list }
env:
PYTHON_MANAGER_INCLUDE_UNMANAGED: false
PYTHON_MANAGER_CONFIG: .\test-config.json
PYMANAGER_DEBUG: true
- name: 'Offline bundle download and install'
run: |
pymanager list --online 3 3-32 3-64 3-arm64
pymanager install --download .\bundle 3 3-32 3-64 3-arm64
pymanager list --source .\bundle
pymanager install --source .\bundle 3 3-32 3-64 3-arm64
env:
PYMANAGER_DEBUG: true
- name: 'Remove MSIX'
run: |
Get-AppxPackage PythonSoftwareFoundation.PythonManager | Remove-AppxPackage
shell: powershell