-
-
Notifications
You must be signed in to change notification settings - Fork 151
115 lines (94 loc) · 3.68 KB
/
test.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
name: test
on:
pull_request:
jobs:
test-matrix:
strategy:
matrix:
os: [ubuntu-18.04, windows-2019, macos-10.15]
arch: [-amd64]
include:
- os: windows-2019
arch: -386
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- name: Disable EOL conversions
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "1.14"
# dependencies used for compiling the GUI
- name: Install Dependencies (Linux)
run: sudo apt update && sudo apt install -y --no-install-recommends build-essential libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev
if: matrix.os == 'ubuntu-18.04'
- name: Install Go deps
# Since 10/23/2019 pwsh is the default shell
# on Windows, but pwsh fails to install protoc-gen-go so
# we force bash as default shell for all OSes in this task
run: |
go get github.com/golangci/govet
go get golang.org/x/lint/golint
- name: Install Taskfile
uses: arduino/actions/setup-taskfile@master
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check the code is good
run: task check
- name: Run unit tests
run: task test-unit
- name: Build the Agent for linux
run: task build
if: matrix.os == 'ubuntu-18.04'
# build the agent without GUI support (no tray icon)
- name: Build the Agent-cli
run: task build-cli
if: matrix.os == 'ubuntu-18.04'
# 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)
# rsrc will produce a *.syso file that should get automatically recognized by go build command and linked into an executable.
- name: Download tool to embed manifest in win binary
run: go get github.com/akavel/rsrc
if: matrix.os == 'windows-2019'
# building the agent for win requires a different task because of an extra flag
- name: Build the Agent for win32
env:
GOARCH: 386 # 32bit architecture (for support)
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)
run: task build-win
if: matrix.os == 'windows-2019' && matrix.arch == '-386'
- name: Build the Agent for win64
run: task build-win # GOARCH=amd64 by default on the runners
if: matrix.os == 'windows-2019' && matrix.arch == '-amd64'
- name: Build the Agent for macos
env:
MACOSX_DEPLOYMENT_TARGET: 10.11 # minimum supported version for mac
CGO_CFLAGS: -mmacosx-version-min=10.11
CGO_LDFLAGS: -mmacosx-version-min=10.11
run: task build
if: matrix.os == 'macos-10.15'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
if: matrix.os == 'macos-10.15'
- name: Run e2e tests
run: |
pip install poetry
task test-e2e
if: matrix.os == 'macos-10.15'
# config.ini is required by the executable when it's run
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
path: |
arduino-create-agent*
config.ini
if-no-files-found: error