-
Notifications
You must be signed in to change notification settings - Fork 15
174 lines (154 loc) · 5.01 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
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
name: CI
on:
push:
branches:
- master
- staging
- trying
pull_request: {}
jobs:
# TODO: drop it when GitHub supports its by itself
cancel-previous:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
linux:
name: ubuntu
strategy:
fail-fast: false
matrix:
# If you change the Matrix values, make sure to update the 'carryforward'
# field of the coveralls app job below.
os: [ ubuntu-latest ]
go: [ 1.22.x ]
firefox: [ "130.0.1", "131.0.3", "132.0" ]
runs-on: ${{ matrix.os }}
env:
FIREFOX_VERSION: ${{ matrix.firefox }}
MOZ_HEADLESS: 1
DISPLAY: ":99.0"
steps:
- name: Set up golang
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Download and install Firefox
run: |
export FIREFOX_SOURCE_URL="https://download.mozilla.org/?product=firefox-$FIREFOX_VERSION&lang=en-US&os=linux64"
wget -O /tmp/firefox.tar.bz2 $FIREFOX_SOURCE_URL
mkdir -p $HOME/firefox
tar -jvxf /tmp/firefox.tar.bz2 -C $HOME/
- name: Startup Firefox in Headless mode
run: |
$HOME/firefox/firefox --version
$HOME/firefox/firefox -marionette > /dev/null 2>&1 &
sleep 10
- name: Confirm Marionette TCP port is open (ubuntu-latest)
run: netstat -ptln
- name: Run Tests
run: go test -test.v -race -coverprofile=coverage.txt -covermode=atomic
- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@v1.0.5
with:
infile: coverage.txt
outfile: coverage.lcov
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov
flag-name: run-${{ matrix.os }}-FF-${{ matrix.firefox }}
parallel: true
code-coverage:
needs: linux
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.os }}-FF-${{ matrix.firefox }}
carryforward: "run-ubuntu-latest-FF-130.0.1,run-ubuntu-latest-FF-131.0.3,run-ubuntu-latest-FF-132.0"
parallel-finished: true
windows:
name: windows
strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
go: [ 1.22.x ]
firefox: [ "130.0.1", "131.0.3", "132.0" ]
runs-on: ${{ matrix.os }}
env:
FIREFOX_VERSION: ${{ matrix.firefox }}
MOZ_HEADLESS: 1
MOZ_MARIONETTE: 1
DISPLAY: ":99.0"
steps:
- name: Set up golang
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Go Version
run: go version
- name: Install Firefox
run: choco install Firefox --force --version=${{ matrix.firefox }} --params "/NoMaintenanceService /RemoveDistributionDir /NoTaskbarShortcut /NoDesktopShortcut /NoAutoUpdate /InstallDir:d:\ff"
- name: Test Firefox
run: |
netsh advfirewall set allprofiles state off
dir d:\ff
d:\ff\firefox.exe -Marionette
tasklist
netstat -aon -p TCP
go test -v -covermode=atomic
osx:
name: mac-os
strategy:
fail-fast: false
matrix:
os: [ macos-latest ]
go: [ 1.22.x ]
firefox: [ "130.0.1", "131.0.3", "132.0" ]
runs-on: ${{ matrix.os }}
env:
FIREFOX_VERSION: ${{ matrix.firefox }}
MOZ_HEADLESS: 1
MOZ_MARIONETTE: 1
DISPLAY: ":99.0"
steps:
- name: Set up golang
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Install Firefox
run: |
export FIREFOX_SOURCE_URL="https://download.mozilla.org/?product=firefox-$FIREFOX_VERSION&lang=en-US&os=osx"
wget -O /tmp/firefox.dmg $FIREFOX_SOURCE_URL
mkdir -p $HOME/firefox
hdiutil attach /tmp/firefox.dmg | grep Volumes
ls -sl /Volumes/Firefox/*
cp -R /Volumes/Firefox/Firefox.app $HOME/firefox/Firefox.app
- name: Startup Firefox in Headless mode
run: |
$HOME/firefox/Firefox.app/Contents/MacOS/firefox --version
ls -sl $HOME/firefox/Firefox.app/Contents/MacOS/*
$HOME/firefox/Firefox.app/Contents/MacOS/firefox -marionette > /dev/null 2>&1 &
sleep 5
netstat -p tcp -van | grep LISTEN
go test -test.v -race -covermode=atomic
ci-pass:
name: 'ci-pass'
runs-on: "ubuntu-latest"
needs: [linux, windows, osx]
steps:
- name: "Merge into master"
run: exit 0