You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TAG_VERSION: ${GITHUB_REF##*/} # will be available to all steps and will be used by task build
16
18
17
19
steps:
18
20
- name: Disable EOL conversions
@@ -53,37 +55,24 @@ jobs:
53
55
run: task test-unit
54
56
55
57
- name: Build the Agent for linux
56
-
run: task build
58
+
run: task build
57
59
if: matrix.operating-system == 'ubuntu-18.04'
58
60
59
61
# build the agent without GUI support (no tray icon)
60
62
- name: Build the Agent-cli
61
63
run: task build-cli
62
64
if: matrix.operating-system == 'ubuntu-18.04'
63
65
64
-
# the manifest is required by windows GUI apps, otherwise the binary will crash with: "Unable to create main window: TTM_ADDTOOL failed" (for reference https://github.com/lxn/walk/issues/28)
65
-
# rsrc will produce a *.syso file that should get automatically recognized by go build command and linked into an executable.
66
-
- name: Download tool to embed manifest in win binary
67
-
run: |
68
-
go get github.com/akavel/rsrc
69
-
if: matrix.operating-system == 'windows-2019'
70
-
71
66
# building the agent for win requires a different task because of an extra flag
72
67
- name: Build the Agent for win32
73
68
env:
74
69
GOARCH: 386# 32bit architecture (for support)
75
70
GO386: 387# support old instruction sets without MMX (used in the Pentium 4) (will be deprecated in GO > 1.15 https://golang.org/doc/go1.15)
76
-
run: |
77
-
rsrc -arch 386 -manifest manifest.xml
78
-
task build-win
79
-
rm *.syso
71
+
run: task build-win
80
72
if: matrix.operating-system == 'windows-2019'
81
73
82
74
- name: Build the Agent for win64
83
-
run: |
84
-
rsrc -arch amd64 -manifest manifest.xml
85
-
task build-win
86
-
rm *.syso
75
+
run: task build-win # GOARCH=amd64 by default on the runners
Copy file name to clipboardExpand all lines: .github/workflows/test.yml
+5-18Lines changed: 5 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -50,45 +50,32 @@ jobs:
50
50
run: task test-unit
51
51
52
52
- name: Build the Agent for linux
53
-
run: task test:build
53
+
run: task build
54
54
if: matrix.operating-system == 'ubuntu-18.04'
55
55
56
56
# build the agent without GUI support (no tray icon)
57
57
- name: Build the Agent-cli
58
-
run: task test:build-cli
58
+
run: task build-cli
59
59
if: matrix.operating-system == 'ubuntu-18.04'
60
60
61
-
# the manifest is required by windows GUI apps, otherwise the binary will crash with: "Unable to create main window: TTM_ADDTOOL failed" (for reference https://github.com/lxn/walk/issues/28)
62
-
# rsrc will produce a *.syso file that should get automatically recognized by go build command and linked into an executable.
63
-
- name: Download tool to embed manifest in win binary
64
-
run: |
65
-
go get github.com/akavel/rsrc
66
-
if: matrix.operating-system == 'windows-2019'
67
-
68
61
# building the agent for win requires a different task because of an extra flag
69
62
- name: Build the Agent for win32
70
63
env:
71
64
GOARCH: 386# 32bit architecture (for support)
72
65
GO386: 387# support old instruction sets without MMX (used in the Pentium 4) (will be deprecated in GO > 1.15 https://golang.org/doc/go1.15)
73
-
run: |
74
-
rsrc -arch 386 -manifest manifest.xml
75
-
task test:build-win
76
-
rm *.syso
66
+
run: task build-win
77
67
if: matrix.operating-system == 'windows-2019'
78
68
79
69
- name: Build the Agent for win64
80
-
run: |
81
-
rsrc -arch amd64 -manifest manifest.xml
82
-
task test:build-win
83
-
rm *.syso
70
+
run: task build-win # GOARCH=amd64 by default on the runners
84
71
if: matrix.operating-system == 'windows-2019'
85
72
86
73
- name: Build the Agent for macos
87
74
env:
88
75
MACOSX_DEPLOYMENT_TARGET: 10.11# minimum supported version for mac
89
76
CGO_CFLAGS: -mmacosx-version-min=10.11
90
77
CGO_LDFLAGS: -mmacosx-version-min=10.11
91
-
run: task test:build
78
+
run: task build
92
79
if: matrix.operating-system == 'macos-10.15'
93
80
94
81
# config.ini is required by the executable when it's run
- go build -v -i -tags cli -o {{.APP_NAME}}_cli {{.LDFLAGS}}
16
+
- task: build
17
+
vars:
18
+
APP_NAME: arduino-create-agent_cli
19
+
ADDITIONAL_FLAGS: -tags cli
14
20
15
21
build-win:
16
-
desc: Build the project for win
22
+
desc: Build the project for win, to build 32bit `export GOARCH=386` and for 64 bit `export GOARCH=amd64` before `task build-win`
17
23
cmds:
18
-
- go build -v -i -o {{.APP_NAME}}_{{.GOARCH}} {{.WIN_LDFLAGS}}
19
-
20
-
test:build:
21
-
desc: Build the project for test.yml
22
-
env:
23
-
cmds:
24
-
- go build -v -i -o {{.APP_NAME}} {{.TEST_LDFLAGS}}
25
-
26
-
test:build-cli:
27
-
desc: Build the project without tray support for test.yml
28
-
cmds:
29
-
- go build -v -i -tags cli -o {{.APP_NAME}}_cli {{.TEST_LDFLAGS}}
30
-
31
-
test:build-win:
32
-
desc: Build the project for win for test.yml
33
-
cmds:
34
-
- go build -v -i -o {{.APP_NAME}}_{{.GOARCH}} {{.TEST_WIN_LDFLAGS}}
35
-
36
-
test:
37
-
desc: Run the full testsuite, `legacy` will be skipped
38
-
cmds:
39
-
- task: test-unit
24
+
# the manifest is required by windows GUI apps, otherwise the binary will crash with: "Unable to create main window: TTM_ADDTOOL failed" (for reference https://github.com/lxn/walk/issues/28)
25
+
- go get github.com/akavel/rsrc
26
+
# rsrc will produce a *.syso file that should get automatically recognized by go build command and linked into an executable.
27
+
- rsrc -arch {{.GOARCH}} -manifest manifest.xml # GOARCH shoud be either amd64 or 386
28
+
- task: build
29
+
vars:
30
+
APP_NAME: arduino-create-agent_{{.GOARCH}}
31
+
WIN_FLAGS: -H=windowsgui
32
+
- rm *.syso # rm file to avoid compilation problems on other platforms
40
33
41
34
test-unit:
42
35
desc: Run unit tests only
@@ -59,43 +52,16 @@ tasks:
59
52
# - task: python:check
60
53
# - task: docs:check
61
54
# - task: config:check
62
-
55
+
63
56
vars:
57
+
TAG_TEST: "0.0.0-dev"
58
+
GOARCH:
59
+
sh: go env GOARCH
64
60
# all modules of this project except for "gen/..." module
0 commit comments