-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.gitlab-ci.yml
183 lines (163 loc) · 4.25 KB
/
.gitlab-ci.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
image: golang:latest
variables:
REPO_NAME: gitlab.com/gomidi/midi/v2
before_script:
- go version
- echo $CI_BUILD_REF
- echo $CI_PROJECT_DIR
- echo $GOPATH
mingo:
image: golang:1.22.2
stage: test
# when: manual
script:
- cd v2
- apt-get update
- apt-get install -y libasound2-dev
- apt-get install -y libportmidi-dev
- go install gitlab.com/gomidi/midi/tools/midicat@latest
- go env
- go fmt $(go list ./... | grep -v /vendor|imported/)
- go vet $(go list ./... | grep -v /vendor|imported/)
- go test $(go list ./... | grep -v /vendor/)
format:
stage: test
# when: manual
script:
- cd v2
- apt-get update
- apt-get install -y libasound2-dev
- apt-get install -y libportmidi-dev
- go install gitlab.com/gomidi/midi/tools/midicat@latest
- go env
- go fmt $(go list ./... | grep -v /vendor|imported/)
- go vet $(go list ./... | grep -v /vendor|imported/)
- go test -race $(go list ./... | grep -v /vendor/)
# - apt-cache search 'asound'
# - apt-cache search 'portmidi'
# - go fmt $(go list ./... | grep -v /drivers/)
# - go vet $(go list ./... | grep -v /drivers/)
# - go test -race $(go list ./... | grep -v /drivers/)
stages:
- build
- test
test-project:
stage: test
# when: manual
script:
- cd v2
- apt-get update
- apt-get install -y libasound2-dev
- apt-get install -y libportmidi-dev
- go install gitlab.com/gomidi/midi/tools/midicat@latest
- go env
- midicat ins
- midicat outs
- go test $(go list ./... | grep -v /vendor/)
test-examples:
stage: test
# when: manual
script:
- cd examples
- apt-get update
- apt-get install -y libasound2-dev
- apt-get install -y libportmidi-dev
- go test $(go list ./... | grep -v /vendor/)
- cd logger
- go test $(go list ./... | grep -v /vendor/)
- cd ../looper
- go test $(go list ./... | grep -v /vendor/)
- cd ../simple
- go test $(go list ./... | grep -v /vendor/)
- cd ../smfplayer
- go test $(go list ./... | grep -v /vendor/)
- cd ../smfrecorder
- go test $(go list ./... | grep -v /vendor/)
- cd ../sysex
- go test $(go list ./... | grep -v /vendor/)
test-tools:
stage: test
# when: manual
script:
- cd tools
- apt-get update
- apt-get install -y libasound2-dev
- apt-get install -y libportmidi-dev
# - cd hyperarp
# - go test $(go list ./... | grep -v /vendor/)
- cd midicat
- go test $(go list ./... | grep -v /vendor/)
- cd ../midispy
- go test $(go list ./... | grep -v /vendor/)
- cd ../smflyrics
- go test $(go list ./... | grep -v /vendor/)
WindowsJob:
stage: test
# when: manual
tags:
# - windows
- saas-windows-medium-amd64
script:
# - go.exe test ./...
- cd v2
- go.exe test $(go list ./... | findstr /v "drivers")
build-midicat:
stage: build
script:
- go env
- apt-get update
- apt-get install -y libasound2-dev
- apt-get install -y libportmidi-dev
- apt-get install -y gcc
- apt-get install -y gcc-mingw-w64
- apt-get install -y g++-mingw-w64-x86-64
- ls /usr/bin/x86_64-*
- mkdir midicat
- mkdir midicat/linux-amd64
- mkdir midicat/win-amd64
# - mkdir midicat/mac-amd64
- cd tools/midicat
- GOOS=linux GOARCH=amd64 CC='gcc' CXX='g++' CGO_ENABLED='1' go build -o ../../midicat/linux-amd64/midicat .
- GOOS=windows GOARCH=amd64 CC='x86_64-w64-mingw32-gcc' CXX='x86_64-w64-mingw32-g++' CGO_ENABLED='1' go build -o ../../midicat/win-amd64/midicat.exe .
# - GOOS=darwin GOARCH=amd64 CC='gcc' CXX='g++' CGO_ENABLED='1' go build -o ../../midicat/mac-amd64/midicat .
artifacts:
paths:
- midicat/
# no free runners
#OSXJob:
# stage: test
# tags:
# - osx
# script:
# - cd v2
# - uname -a
# - go test $(go list ./... | grep -v /drivers/)
#OSXJob:
# stage: test
# tags:
# - osx
# script:
# - uname -a
# - go test ./...
#build-project:
# stage: build
# script:
# - OUTPUT="output"
# - bash build-all.sh $OUTPUT $CI_PROJECT_DIR
#
# artifacts:
# paths:
# - artifacts/
#WindowsJob:
# stage: test
# tags:
# - windows
# script:
# - go.exe test ./...
#OSXJob:
# stage: test
# tags:
# - osx
# script:
# - uname -a
# - go test ./...