-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathappveyor.yml
71 lines (54 loc) · 3.14 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
version: '1.0.0-beta3.{build}'
platform: x64
clone_folder: C:\Users\appveyor\go\src\github.com\herloct\url-parser
artifacts:
- path: build\url-parser-Windows-x86_64.exe
name: binary
install:
- cinst upx
before_build:
- go version
- go env
- go test -v
build_script:
- go build -o build\url-parser.exe
- upx build\url-parser.exe
test_script:
- bash -lc "build/url-parser.exe --help || echo \"Shows the help\""
- bash -lc "build/url-parser.exe || echo \"This should be failed\""
- bash -lc '[[ $(build/url-parser.exe "https://google.com") == "https://google.com" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=all "https://google.com") == "https://google.com" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=scheme "https://google.com") == "https" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=user "https://google.com") == "" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=user "https://username@google.com") == "username" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=password "https://google.com") == "" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=password "https://username@google.com") == "" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=password "https://username:mypassword@google.com") == "mypassword" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=hostname "https://google.com") == "google.com" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=port "https://google.com") == "" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=port "https://google.com:123") == "123" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=path "https://google.com") == "" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=path "https://google.com/path/to") == "/path/to" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=path --path-index=0 "https://google.com/path/to") == "path" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=path --path-index=1 "https://google.com/path/to") == "to" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=query "https://google.com") == "" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=query "https://google.com/?some-key=value&other-key=other") == "some-key=value&other-key=other" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=query --query-field=some-key "https://google.com/?some-key=value&other-key=other") == "value" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=query --query-field=other-key "https://google.com/?some-key=value&other-key=other") == "other" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=query --query-field=unknown "https://google.com/?some-key=value&other-key=other") == "" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=fragment "https://google.com") == "" ]]'
- bash -lc '[[ $(build/url-parser.exe --part=fragment "https://google.com/#some") == "some" ]]'
after_test:
- copy "build\url-parser.exe" "build\url-parser-Windows-x86_64.exe"
deploy:
tag: $(appveyor_repo_tag_name)
description: |
* Re enable UPX so we could get far smaller binary size.
provider: GitHub
auth_token:
secure: Z2BZL6xX7hIQqvyEU9Acaf9xGc84LwvaRoJdLk+tSmHkJcyxA8MgHKNHvbbx48IH
artifact: binary
prerelease: true
force_update: true
on:
appveyor_repo_tag: true