-
Notifications
You must be signed in to change notification settings - Fork 525
102 lines (98 loc) · 3.32 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
name: Node CI
on:
pull_request:
types: [ opened, synchronize, edited ]
push:
branches:
- dev-*
jobs:
test:
runs-on: ubuntu-latest
permissions:
actions: none
checks: none
contents: read
deployments: none
id-token: none
issues: none
discussions: none
packages: none
pages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
env:
emscripten_version: 3.1.59
strategy:
matrix:
node-version: [ 20.11.1 ]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
submodules: 'true'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 #v4.0.2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Get better-sqlite3 cached location
run: |
echo "better_sqlite3_path=$(node buildSrc/getNativeCacheLocation.js better-sqlite3)" >> $GITHUB_ENV
- name: try to use cached better-sqlite3
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2
with:
path: ${{ env.better_sqlite3_path }}
key: ${{ env.better_sqlite3_path }}
- name: install packages
run: npm ci
- name: lint, formatting
run: |
npm run check
- name: get emscripten cached location
run: |
echo "emscripten_path=$(pwd)/emsdk" >> $GITHUB_ENV
- name: cache emscripten
id: cache-emscripten
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ${{ env.emscripten_path }}
key: emscripten-${{ env.emscripten_version }}
- name: install emscripten
if: steps.cache-emscripten.outputs.cache-hit != 'true'
run: |
git clone --branch ${{ env.emscripten_version }} https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
- name: add emscripten to path
run: |
echo ${{ env.emscripten_path }}/upstream/bin >> $GITHUB_PATH
echo ${{ env.emscripten_path }}/upstream/emscripten >> $GITHUB_PATH
- name: run test in node
run: |
npm run build-packages
npm run test-ci
- name: install chrome
id: setup-chrome
uses: browser-actions/setup-chrome@97349de5c98094d4fc9412f31c524d7697115ad8 #v1.5.0
with:
chrome-version: stable
- name: run test in browser
timeout-minutes: 3
run: |
echo Chrome version: ${{ steps.setup-chrome.outputs.chrome-version }}
npm run test:app -- --no-run --browser --browser-cmd '${{ steps.setup-chrome.outputs.chrome-path }} --enable-logging=stderr --headless=new --disable-gpu'
- name: build web app
run: |
node webapp --disable-minify
- name: check for FIXMEs
run: |
if grep "FIXME\|[fF]ixme" -r src buildSrc test/tests packages/*/lib app-android/app/src app-ios/tutanota/Sources; then
echo 'FIXMEs in src';
exit 1;
else
echo 'No FIXMEs in src';
fi