-
Notifications
You must be signed in to change notification settings - Fork 45
248 lines (240 loc) · 7.81 KB
/
linux.yaml
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
name: Linux
# To debug a job, add the following step:
# - name: Debug with tmate
# uses: mxschmitt/action-tmate@v3
on:
push:
branches:
- master
pull_request:
paths-ignore:
- '.github/workflows/macos.yaml'
env:
COZY_DESKTOP_DIR: "${{ github.workspace }}/cozy-desktop"
COZY_STACK_STORAGE: "${{ github.workspace }}/storage"
COZY_URL: "http://cozy.localhost:8080"
COZY_PASSPHRASE: "cozy"
GO111MODULE: "on"
NODE_ENV: "test"
COZY_DESKTOP_HEARTBEAT: "1000"
DISPLAY: ":99.0"
NODE_VERSION: "18.12.1"
GO_VERSION: "1.21"
COUCHDB_VERSION: "3.2.2"
COUCHDB_USER: "admin"
COUCHDB_PASSWORD: "password"
jobs:
cancel:
name: 'Cancel Previous Runs'
runs-on: ubuntu-20.04
timeout-minutes: 3
steps:
- uses: styfle/cancel-workflow-action@5df4e62aed82ea1f787d2a02ab3dbfcaa49ffdd1
unit:
needs: cancel
runs-on: ubuntu-20.04
name: Lint & Unit tests
steps:
- uses: actions/checkout@v3
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
${{ github.workspace }}/node_modules
~/.cache/electron
~/.cache/electron-builder
key: ${{ runner.os }}-v${{ env.NODE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup golang
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup python
run: pip install setuptools
- name: Setup CouchDB
id: setup-couchdb
uses: 'taratatach/couchdb-action@v4.6-dev'
with:
couchdb version: ${{ env.COUCHDB_VERSION }}
couchdb user: ${{ env.COUCHDB_USER }}
couchdb password: ${{ env.COUCHDB_PASSWORD }}
- name: Setup cozy-stack
uses: ./.github/actions/setup-cozy-stack
with:
couchdb-url: ${{ steps.setup-couchdb.outputs.couchdb-url }}
- name: Setup local env
run: |
mkdir -p "$COZY_DESKTOP_DIR"
echo "NODE_ENV=test" > "${{ github.workspace }}/.env.test"
- name: Install dependencies
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: yarn install
- name: Rebuild native plugins
run: yarn install:electron
- name: Start Xvfb
run: sudo Xvfb :99 -ac -screen 0 1024x768x8 &
- name: Build elm
run: yarn build:elm
- name: Lint
run: yarn lint
- name: Elm tests
run: yarn test:elm
- name: World tests
run: yarn test:world --forbid-only
- name: Unit tests
run: yarn test:unit --forbid-only
integration:
needs: cancel
runs-on: ubuntu-20.04
name: Integration tests
steps:
- uses: actions/checkout@v3
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
${{ github.workspace }}/node_modules
~/.cache/electron
~/.cache/electron-builder
key: ${{ runner.os }}-v${{ env.NODE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup golang
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup python
run: pip install setuptools
- name: Setup CouchDB
id: setup-couchdb
uses: 'taratatach/couchdb-action@v4.6-dev'
with:
couchdb version: ${{ env.COUCHDB_VERSION }}
couchdb user: ${{ env.COUCHDB_USER }}
couchdb password: ${{ env.COUCHDB_PASSWORD }}
- name: Setup cozy-stack
uses: ./.github/actions/setup-cozy-stack
with:
couchdb-url: ${{ steps.setup-couchdb.outputs.couchdb-url }}
- name: Setup local env
run: |
mkdir -p "$COZY_DESKTOP_DIR"
echo "NODE_ENV=test" > "${{ github.workspace }}/.env.test"
- name: Install dependencies
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: yarn install
- name: Rebuild native plugins
run: yarn install:electron
- name: Start Xvfb
run: sudo Xvfb :99 -ac -screen 0 1024x768x8 &
- name: Integration tests
run: yarn test:integration --forbid-only
scenarios:
needs: cancel
runs-on: ubuntu-20.04
name: Scenarios
strategy:
matrix:
stopped_client: ['', 'STOPPED']
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
${{ github.workspace }}/node_modules
~/.cache/electron
~/.cache/electron-builder
key: ${{ runner.os }}-v${{ env.NODE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup golang
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup python
run: pip install setuptools
- name: Setup CouchDB
id: setup-couchdb
uses: 'taratatach/couchdb-action@v4.6-dev'
with:
couchdb version: ${{ env.COUCHDB_VERSION }}
couchdb user: ${{ env.COUCHDB_USER }}
couchdb password: ${{ env.COUCHDB_PASSWORD }}
- name: Setup cozy-stack
uses: ./.github/actions/setup-cozy-stack
with:
couchdb-url: ${{ steps.setup-couchdb.outputs.couchdb-url }}
- name: Setup local env
run: |
mkdir -p "$COZY_DESKTOP_DIR"
echo "NODE_ENV=test" > "${{ github.workspace }}/.env.test"
- name: Install dependencies
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: yarn install
- name: Rebuild native plugins
run: yarn install:electron
- name: Start Xvfb
run: sudo Xvfb :99 -ac -screen 0 1024x768x8 &
- name: Scenarios
env:
STOPPED_CLIENT: ${{ matrix.stopped_client == 'STOPPED' }}
run: yarn test:scenarios --forbid-only
build:
needs: cancel
runs-on: ubuntu-20.04
name: Build packages
steps:
- uses: actions/checkout@v3
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
${{ github.workspace }}/node_modules
~/.cache/electron
~/.cache/electron-builder
key: ${{ runner.os }}-v${{ env.NODE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup python
run: pip install setuptools
- name: Install dependencies
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: yarn install:all
- name: Build assets
run: yarn build
- name: Build packages
uses: ./.github/actions/build-and-publish
with:
gh-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Save artifacts
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: Binaries
path: |
${{ github.workspace }}/dist/latest-linux.yml
${{ github.workspace }}/dist/Cozy[- ]Drive[- ]*.AppImage
retention-days: 5