forked from ActivityWatch/activitywatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
156 lines (126 loc) · 5.5 KB
/
.appveyor.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
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
#
# Based on: https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml
#
environment:
global:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\scripts\\ci\\run_with_env.cmd"
matrix:
# Pre-installed Python versions, which Appveyor may upgrade to
# a later point release.
# See: http://www.appveyor.com/docs/installed-software#python
- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.x" # currently 3.6.8
PYTHON_ARCH: "64"
#- PYTHON: "C:\\Python35-x64"
# PYTHON_VERSION: "3.5.x" # currently 3.5.2
# PYTHON_ARCH: "64"
install:
# Enable long paths
- "./scripts/ci/enable_long_paths.bat"
# Clone submodules
- "git submodule update --init --recursive"
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
# purpose but it is problematic because it tends to cancel builds pushed
# directly to master instead of just PR builds (or the converse).
# credits: JuliaLang developers.
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
- ECHO "Filesystem root:"
- ps: "ls \"C:/\""
- ECHO "Installed SDKs:"
- ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""
# Install Python (from the official .msi of http://python.org) and pip when
# not already installed.
- ps: if (-not(Test-Path($env:PYTHON))) { & scripts\ci\install_python.ps1 }
# Install Rust nightly and add it to PATH
- appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init -yv --default-toolchain nightly
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin
- rustc -vV
- cargo -vV
# Required in order to get `make` to work
- "copy C:\\MinGW\\bin\\mingw32-make.exe C:\\MinGW\\bin\\make.exe"
# Use MinGW
- "SET PATH=C:\\MinGW\\bin;%PATH%"
# Use cygwin stuff for make, bash, etc.
# NOTE: Don't, better to use MinGW tooling
#- "SET PATH=C:\\cygwin\\bin;%PATH%"
# Prepend newly installed Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
# pyrcc5.exe can be found here:
# C:\Users\erb\AppData\Roaming\Python\Python35\Scripts\pyrcc5.exe
- "SET PATH=%PYTHON%;%PATH%"
- "SET PATH=%PYTHON%\\Scripts;%PATH%"
# Create bin overrides dir and add it to path
- ps: "mkdir C:/bin-override/"
- "SET PATH=C:\\bin-override\\;%PATH%"
# FIXME: Created due to issue #51 (mypy issues on Appveyor)
- "copy .\\scripts\\nop.sh C:\\bin-override\\mypy"
# For debugging: Echo the path variable, one path per line
- ps: "$env:path.split(\";\")"
- ECHO "%PYTHON%"
# Check that we have the expected version and architecture for Python
- "%CMD_IN_ENV% python --version"
- "%CMD_IN_ENV% python -c \"import struct; print(struct.calcsize('P') * 8)\""
# Install node and npm
- ps: "./scripts/ci/install_node.ps1"
- "SET PATH=C:\\Program Files\\nodejs;%PATH%"
# Upgrade to the latest version of pip to avoid it displaying warnings
# about it being out of date.
# Disabled for same reason as specified here:
# - https://github.com/ActivityWatch/aw-core/commit/e19ce9ea10912cf105859f97b8a7836dadd0fe58#diff-180360612c6b8c4ed830919bbb4dd459
- "%CMD_IN_ENV% python -m pip install --upgrade pip"
# Install poetry and virtualenv
- "%CMD_IN_ENV% python -m pip install poetry virtualenv"
# Create build virtualenv
- "virtualenv --clear venv"
- "venv\\Scripts\\activate.bat"
# Testing dependencies
- "%CMD_IN_ENV% poetry install"
# Build dependencies
# Don't install as user, since that puts the pyrcc5 script in a user-specific place
- "%CMD_IN_ENV% pip install --upgrade pyqt5"
- "%CMD_IN_ENV% powershell scripts\\ci\\install_pyhook.ps1"
build_script:
# Build the compiled extension
- "%CMD_IN_ENV% make build"
- "%CMD_IN_ENV% make install"
#- "%CMD_IN_ENV% python setup.py build"
test_script:
# Run the project tests
- "%CMD_IN_ENV% make test"
# Freezes in appveyor for whatever reason
# See: https://github.com/ActivityWatch/activitywatch/pull/56
#- "%CMD_IN_ENV% make test-integration"
after_test:
# If tests are successful, create binary packages for the project.
#- "%CMD_IN_ENV% python setup.py bdist_wheel"
#- "%CMD_IN_ENV% python setup.py bdist_wininst"
#- "%CMD_IN_ENV% python setup.py bdist_msi"
#- ps: "ls dist"
- "%CMD_IN_ENV% make package"
artifacts:
# Archive the generated packages in the ci.appveyor.com build report.
- path: dist\*.zip
- path: dist\*.exe
deploy:
# release: myproduct-v$(appveyor_build_version) # optional
description: '' # required to be non-null by the GitHub releases API
provider: GitHub
auth_token:
secure: fI8Ar/HiYNXcmeXQct/yzkKeEF4MHdYgP5/XL7uHKNs4lhPyUmT6GSltcLwkqk45
artifact: /.*\.(zip|exe)/
draft: true
prerelease: true
on:
appveyor_repo_tag: true # deploy on tag push only
# branch: master # release from master branch only
#on_success:
# - TODO: upload the content of dist/*.whl to a public wheelhouse