Skip to content

Commit 937ce6d

Browse files
committed
appveyor updates
1 parent 0fc5fee commit 937ce6d

File tree

3 files changed

+28
-34
lines changed

3 files changed

+28
-34
lines changed

appveyor.yml

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
environment:
22
matrix:
3-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
4-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
5-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
6-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
3+
- julia_version: 1.0
4+
- julia_version: latest
75

8-
## uncomment the following lines to allow failures on nightly julia
9-
## (tests will run but not make your overall status red)
6+
platform:
7+
- x86 # 32-bit
8+
- x64 # 64-bit
9+
10+
# uncomment the following lines to allow failures on nightly julia
11+
# (tests will run but not make your overall status red)
1012
matrix:
11-
allow_failures:
12-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
13-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
13+
allow_failures:
14+
- julia_version: latest
1415

1516
branches:
1617
only:
@@ -24,24 +25,12 @@ notifications:
2425
on_build_status_changed: false
2526

2627
install:
27-
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
28-
# If there's a newer build queued for the same PR, cancel this one
29-
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
30-
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
31-
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
32-
throw "There are newer queued builds for this pull request, failing early." }
33-
# Download most recent Julia Windows binary
34-
- ps: (new-object net.webclient).DownloadFile(
35-
$env:JULIA_URL,
36-
"C:\projects\julia-binary.exe")
37-
# Run installer silently, output to C:\projects\julia
38-
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
28+
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))
3929

4030
build_script:
41-
# Need to convert from shallow to complete for Pkg.clone to work
42-
- IF EXIST .git\shallow (git fetch --unshallow)
43-
- C:\projects\julia\bin\julia -e "versioninfo();
44-
Pkg.clone(pwd(), \"TickTock\"); Pkg.build(\"TickTock\")"
31+
- echo "%JL_BUILD_SCRIPT%"
32+
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"
4533

4634
test_script:
47-
- C:\projects\julia\bin\julia -e "Pkg.test(\"TickTock\")"
35+
- echo "%JL_TEST_SCRIPT%"
36+
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"

src/TickTock.jl

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,25 @@ laptimer() = showtimes(canonical=true)
116116
alarm(hours, minutes, seconds;
117117
action = () -> @info("TickTock: time's up"))
118118
119-
Run an alarm, with the option of providing a anonymous function that executes
119+
Set an alarm, with the option of providing a anonymous function that executes
120120
when alarm fires.
121121
122122
```
123123
using Dates
124124
125125
@async alarm(0, 5, 0, action = ()-> println("TickTock.jl: 5 minutes is up!"))
126+
127+
@async alarm(0, 0, 5, action = () -> run(`say "your alarm is ringing, sir"`), alarmname="tea's up") # uses macOS speech
126128
```
127129
"""
128130
function alarm(hours, minutes, seconds;
129-
action=() -> @info("TickTock: alarm: time's up"))
131+
action=() -> @info("TickTock: alarm"),
132+
alarmname="TickTock alarm")
130133
tick()
131134
while true
132135
sleep(5)
133136
if peektimer() > hours * 60 * 60 + minutes * 60 + seconds
137+
@info alarmname
134138
action()
135139
tock()
136140
break
@@ -152,7 +156,7 @@ using Dates
152156
153157
dt = now() + Dates.Minute(1)
154158
155-
@async alarm(dt, action=()-> println("TickTock.jl: Ready!"))
159+
@async alarm(dt, action = () -> println("TickTock.jl: Ready!"))
156160
```
157161
158162
```
@@ -162,21 +166,22 @@ dt = now() + Dates.Minute(1)
162166
TODO alarms don't appear in timer lists...
163167
"""
164168
function alarm(dt::DateTime;
165-
action = () -> @info("TickTock: alarm: time's up"))
169+
action = () -> @info("TickTock: alarm"),
170+
alarmname = "TickTock alarm")
166171
p = Dates.Period(dt - now())
167172
secs = round(p, Dates.Second).value
168173
m, s = divrem(secs, 60)
169174
h, m = divrem(m, 60)
170-
@info "TickTock: setting alarm for $h hours, $m minutes, $s seconds"
171-
alarm(h, m, s, action=action)
175+
@info "TickTock: \"$(alarmname)\" alarm for $h hours, $m minutes, $s seconds"
176+
alarm(h, m, s, action=action, alarmname=alarmname)
172177
end
173178

174179
"""
175180
@async alarm(now() + Dates.Second(5), action = () -> TickTock.alarmnotify("time's up"))
176181
177182
TODO this is macOS only...
178183
"""
179-
function alarmnotify(subtitle="time's up")
184+
function alarmnotify(subtitle="TickTock alarm")
180185
!Sys.isapple() && exit()
181186
command = """
182187
display notification with title "TickTock.jl" subtitle \"$(subtitle)\" sound name "frog"

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sleep(1)
99
@async alarm(now() + Dates.Minute(0) + Dates.Second(10),
1010
action=() ->
1111
begin
12-
println("test alarm set at $(now()) for 10 seconds has fired")
12+
println("test alarm has fired")
1313
end)
1414

1515
alarmmessage() = println("This is an alarm. Do not be alarmed.")

0 commit comments

Comments
 (0)