-
Notifications
You must be signed in to change notification settings - Fork 1
123 lines (102 loc) · 2.71 KB
/
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
name: CI
on: [push, pull_request]
env:
GO_VERSION: '1.21'
TASK_VERSION: 'v3.28'
jobs:
bsd:
runs-on: ${{ matrix.os.host }}
strategy:
fail-fast: false
matrix:
os:
- name: freebsd
architecture: x86-64
version: '14.1'
host: ubuntu-latest
- name: openbsd
architecture: x86-64
version: '7.5'
host: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run CI script on ${{ matrix.os.name }}
uses: cross-platform-actions/[email protected]
with:
operating_system: ${{ matrix.os.name }}
architecture: ${{ matrix.os.architecture }}
version: ${{ matrix.os.version }}
shell: bash
run: |
case "$(uname)" in
FreeBSD)
sudo pkg install -y go
;;
NetBSD)
sudo pkgin -y install go
for bin in /usr/pkg/bin/go1*; do
src=$bin
done
sudo ln -s "$src" /usr/pkg/bin/go
;;
OpenBSD)
sudo pkg_add -I go
;;
esac
PATH=$(go env GOPATH)/bin:$PATH
go install 'github.com/go-task/task/v3/cmd/task@${{ env.TASK_VERSION }}'
task
linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Task
run: |
go install github.com/go-task/task/v3/cmd/task@"$TASK_VERSION"
- name: Build and test
run: |
task
mac:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Task
run: |
go install github.com/go-task/task/v3/cmd/task@"$TASK_VERSION"
- name: Build and test
run: |
task
windows:
runs-on: windows-latest
steps:
- name: 'Disable `autocrlf` in Git'
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install Task
run: |
go install github.com/go-task/task/v3/cmd/task@$env:TASK_VERSION
- name: Build and test
run: |
task
- name: Upload Windows binary
uses: actions/upload-artifact@v4
with:
name: memsparkline-windows-amd64
path: |
memsparkline.exe