-
Notifications
You must be signed in to change notification settings - Fork 145
81 lines (65 loc) · 1.93 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: CI
on:
push:
branches:
- 'master'
- 'renovate/*'
- 'release/*'
- 'ci/*'
pull_request:
branches:
- '*'
- '!translations'
- '!renovate/*'
- '!release/*'
- '!ci/*'
types: [assigned, opened, synchronize, reopened]
jobs:
test:
name: Run tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
node_version: [16.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: set git config
run: |
git config --global core.eol lf
git config --global core.autocrlf false
- 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@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: setup nodejs
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- name: install yarn
run: npm install -g yarn
- name: get yarn cache dir
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: install dependencies
run: yarn
- name: lint code
run: yarn lint
- name: typescript compile
run: yarn tsc
- name: unit tests
run: yarn test:ci
- name: coverage
uses: codecov/codecov-action@v3
- name: electron build
run: yarn package:ci
if: startsWith(github.ref, 'refs/heads/release/')
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}