-
Notifications
You must be signed in to change notification settings - Fork 145
61 lines (48 loc) · 1.59 KB
/
main.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
name: CI
on:
push:
branches:
- 'master'
- 'release/*'
- 'ci/*'
pull_request:
jobs:
test:
name: Run tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# Run always on push, or on pull requests that are not from release or ci branches. This prevents duplicate runs.
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'release/') && !startsWith(github.head_ref, 'ci/'))
strategy:
matrix:
node_version: [20.x]
os: [ubuntu-latest, windows-latest, macos-13]
steps:
- name: ubuntu file watcher tweak
if: matrix.os == 'ubuntu-latest'
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- uses: actions/checkout@v4
- name: setup nodejs
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- name: install dependencies
run: yarn install --frozen-lockfile --network-timeout 1000000
- name: lint code
run: yarn lint
- name: typescript compile
run: yarn tsc
- name: unit tests
run: yarn test:ci
- name: build check
if: startsWith(github.ref_name, 'release/') == false
run: yarn build
- name: coverage
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: electron build
run: yarn package:ci
if: startsWith(github.ref_name, 'release/')
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}