-
-
Notifications
You must be signed in to change notification settings - Fork 190
292 lines (283 loc) · 9.76 KB
/
tests.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
###############################################################################
# .github/workflows/tests.yml
#
# NOTE: GitHub Actions does not allocate a TTY, preventing `nb` from detecting
# piped input using `[[ -t 0 ]]` in the `_interactive_input()` function.
#
# More information:
#
# https://github.com/actions/runner/issues/241
#
# faketty is a GitHub action that uses work-arounds to provide a tty:
#
# https://github.com/marketplace/actions/faketty
#
# Scripts used by faketty for each platform:
#
# linux: `faketty`
#
# ```bash
# #!/bin/bash
#
# script -q -e -c "$*"
# ```
#
# win32: `faketty.ps1`
#
# ```posh
# Invoke-Expression "$args"
# ```
#
# darwin: `faketty`
#
# requires: `brew install expect`
#
# ```bash
# #!/bin/bash
#
# unbuffer $*
# ```
###############################################################################
name: "nb · Test Suite"
on:
pull_request:
branches: [ master ]
# push:
# branches: [ master ]
workflow_dispatch:
jobs:
# test-ubuntu-aarch64:
# name: "Test: Ubuntu AArch64"
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/[email protected]
# - uses: uraimo/run-on-arch-action@v2
# # https://github.com/marketplace/actions/run-on-architecture
# name: Run commands
# id: runcmd
# with:
# arch: aarch64
# distro: ubuntu20.04
# # Not required, but speeds up builds by storing container images in
# # a GitHub package registry.
# # githubToken: ${{ github.token }}
# # Set an output parameter `uname` for use in subsequent steps
# run: |
# uname -a
# echo ::set-output name=uname::$(uname -a)
# - name: "Setup"
# run: |
# sudo apt-get update
# sudo apt-get install bats -y
# sudo apt-get install ncat -y
# sudo apt-get install python-pygments -y
# sudo apt-get install w3m -y
# curl -LO https://github.com/jgm/pandoc/releases/download/2.17.0.1/pandoc-2.17.0.1-1-amd64.deb
# sudo dpkg -i pandoc-2.17.0.1-1-amd64.deb
# curl -LO https://github.com/sharkdp/bat/releases/download/v0.16.0/bat_0.16.0_amd64.deb
# sudo dpkg -i bat_0.16.0_amd64.deb
# git config --global user.name "Example Name"
# git config --global user.email "[email protected]"
# - name: "Install bats-core"
# run: |
# git clone https://github.com/bats-core/bats-core.git "${HOME}/bats-core" &&
# cd "${HOME}/bats-core"
# git checkout 2e2e5df6adf0b846b411b6b2f7bb654cbc3e2c4e
# sudo ./install.sh /usr/local
# - name: "Set $TERM=xterm"
# run: printf "TERM=xterm\\n" >> $GITHUB_ENV
# - name: "Run bats tests"
# run: script -q -e -c "bats test/bookmark.bats"
# # - name: "Install Go"
# # uses: actions/setup-go@v2
# # - name: "Run go test"
# # run: cd nb.go && go test
# # - name: "Run nb.go bats tests"
# # run: script -q -e -c "bats test"
# test-ubuntu-armv7:
# name: "Test: Ubuntu armv7"
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/[email protected]
# - uses: uraimo/run-on-arch-action@v2
# # https://github.com/marketplace/actions/run-on-architecture
# name: Run commands
# id: runcmd
# with:
# arch: armv7
# distro: ubuntu20.04
# # Not required, but speeds up builds by storing container images in
# # a GitHub package registry.
# # githubToken: ${{ github.token }}
# # Set an output parameter `uname` for use in subsequent steps
# run: |
# uname -a
# echo ::set-output name=uname::$(uname -a)
# - name: "Setup"
# run: |
# sudo apt-get update
# sudo apt-get install bats -y
# sudo apt-get install ncat -y
# sudo apt-get install python-pygments -y
# sudo apt-get install w3m -y
# curl -LO https://github.com/jgm/pandoc/releases/download/2.17.0.1/pandoc-2.17.0.1-1-amd64.deb
# sudo dpkg -i pandoc-2.17.0.1-1-amd64.deb
# curl -LO https://github.com/sharkdp/bat/releases/download/v0.16.0/bat_0.16.0_amd64.deb
# sudo dpkg -i bat_0.16.0_amd64.deb
# git config --global user.name "Example Name"
# git config --global user.email "[email protected]"
# - name: "Install bats-core"
# run: |
# git clone https://github.com/bats-core/bats-core.git "${HOME}/bats-core" &&
# cd "${HOME}/bats-core"
# git checkout 2e2e5df6adf0b846b411b6b2f7bb654cbc3e2c4e
# sudo ./install.sh /usr/local
# - name: "Set $TERM=xterm"
# run: printf "TERM=xterm\\n" >> $GITHUB_ENV
# - name: "Run bats tests"
# run: script -q -e -c "bats test/bookmark.bats"
# # - name: "Install Go"
# # uses: actions/setup-go@v2
# # - name: "Run go test"
# # run: cd nb.go && go test
# # - name: "Run nb.go bats tests"
# # run: script -q -e -c "bats test"
test-macos-12:
name: "Test: macOS 12 Monterey"
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: "Setup"
run: |
brew update
brew install bat
brew install bats-core
brew install expect
brew install gpg
brew install nmap
brew install pandoc
brew install ripgrep
brew install w3m
gem install asciidoctor
git config --global user.name "Example Name"
git config --global user.email "[email protected]"
- uses: browser-actions/setup-chrome@v1
id: setup-chrome
- run: |
${{ steps.setup-chrome.outputs.chrome-path }} --version
- name: "Set $TERM=xterm"
run: printf "TERM=xterm\\n" >> $GITHUB_ENV
- name: "Run bats tests"
run: unbuffer bats test
# - name: "Install Go"
# uses: actions/setup-go@v2
# - name: "Run go test"
# run: cd nb.go && go test
# - name: "Run nb.go bats test"
# run: unbuffer bats test
# test-macos-11:
# name: "Test: macOS Big Sur 11.0"
# runs-on: macos-11.0
# steps:
# - uses: actions/checkout@v3
# - name: "Setup"
# run: |
# brew update
# brew install bat
# brew install bats-core
# brew install expect
# brew install gpg
# brew install nmap
# brew install pandoc
# brew install ripgrep
# brew install w3m
# gem install asciidoctor
# git config --global user.name "Example Name"
# git config --global user.email "[email protected]"
# - name: "Set $TERM=xterm"
# run: printf "TERM=xterm\\n" >> $GITHUB_ENV
# - name: "Run bats tests"
# run: unbuffer bats test
# # - name: "Install Go"
# # uses: actions/setup-go@v2
# # - name: "Run go test"
# # run: cd nb.go && go test
# # - name: "Run nb.go bats test"
# # run: unbuffer bats test
# test-macos-10-15:
# name: "Test: macOS Catalina 10.15"
# runs-on: macos-10.15
# steps:
# - uses: actions/checkout@v1
# - name: "Setup"
# run: |
# brew update
# brew install bat
# brew unlink bats
# brew install bats-core
# brew install expect
# brew install gpg
# brew install nmap
# brew install pandoc
# brew install w3m
# git config --global user.name "Example Name"
# git config --global user.email "[email protected]"
# - name: "Set $TERM=xterm"
# run: printf "TERM=xterm\\n" >> $GITHUB_ENV
# - name: "Run bats tests"
# run: unbuffer bats test
# # - name: "Install Go"
# # uses: actions/setup-go@v2
# # - name: "Run go test"
# # run: cd nb.go && go test
# # - name: "Run nb.go bats test"
# # run: unbuffer bats test
test-ubuntu-2404:
name: "Test: Ubuntu 24.04"
runs-on: ubuntu-24.04
env:
LANG: C.UTF-8
LC_ALL: C.UTF-8
LC_TYPE: C.UTF-8
steps:
- uses: actions/checkout@v1
- name: "Setup"
run: |
sudo apt-get update
sudo apt-get install bats -y
sudo apt-get install ncat -y
sudo apt-get install python-pygments -y
sudo apt-get install ripgrep -y
sudo apt-get install w3m -y
curl -LO https://github.com/jgm/pandoc/releases/download/3.2/pandoc-3.2-1-amd64.deb
sudo dpkg -i pandoc-3.2-1-amd64.deb
curl -LO https://github.com/sharkdp/bat/releases/download/v0.24.0/bat_0.24.0_amd64.deb
sudo dpkg -i bat_0.24.0_amd64.deb
sudo gem install asciidoctor
git config --global user.name "Example Name"
git config --global user.email "[email protected]"
- uses: browser-actions/setup-chrome@v1
id: setup-chrome
- run: |
${{ steps.setup-chrome.outputs.chrome-path }} --version
- name: "Install bats-core"
run: |
git clone https://github.com/bats-core/bats-core.git "${HOME}/bats-core" &&
cd "${HOME}/bats-core"
git checkout 2e2e5df6adf0b846b411b6b2f7bb654cbc3e2c4e
sudo ./install.sh /usr/local
- name: "Set $TERM=xterm"
run: printf "TERM=xterm\\n" >> $GITHUB_ENV
- name: "Print encoding variables"
run: |
echo "'$LANG'"
echo "'$LC_ALL'"
echo "'$LC_TYPE'"
- name: "Run bats tests"
run: script -q -e -c "bats test"
# - name: "Install Go"
# uses: actions/setup-go@v2
# - name: "Run go test"
# run: cd nb.go && go test
# - name: "Run nb.go bats tests"
# run: script -q -e -c "bats test"