1+ name : build
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ jobs :
10+
11+ build :
12+ runs-on : ${{ matrix.os }}
13+
14+ strategy :
15+ matrix :
16+ os : [ubuntu-latest]
17+ node-version : [16.x]
18+
19+ steps :
20+ - name : install dependencies on ubuntu
21+ if : startsWith(matrix.os,'ubuntu')
22+ run : |
23+ sudo apt install -y make gcc pkg-config build-essential libx11-dev libxkbfile-dev
24+
25+ - uses : actions/checkout@v2
26+
27+ - name : Use Node.js ${{ matrix.node-version }}
28+ uses : actions/setup-node@v1
29+ with :
30+ node-version : ${{ matrix.node-version }}
31+
32+ - name : Get yarn cache directory path
33+ id : yarn-cache-dir-path
34+ run : echo "::set-output name=dir::$(yarn cache dir)"
35+
36+ - name : Cache node_modules with yarn
37+ uses : actions/cache@v2
38+ id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
39+ with :
40+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
41+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
42+ restore-keys : |
43+ ${{ runner.os }}-yarn-
44+
45+ - run : yarn --frozen-lockfile
46+
47+ tests :
48+ timeout-minutes : 60
49+ runs-on : ubuntu-latest
50+ steps :
51+ - uses : actions/checkout@v3
52+ - uses : actions/setup-node@v3
53+ with :
54+ node-version : 16
55+ - name : Install dependencies
56+ run : yarn
57+ - name : Run tests
58+ uses : coactions/setup-xvfb@v1
59+ with :
60+ run : yarn test
61+
62+ code-lint :
63+ runs-on : ubuntu-latest
64+
65+ steps :
66+ - name : Check out Git repository
67+ uses : actions/checkout@v2
68+
69+ - uses : actions/setup-node@v1
70+ with :
71+ node-version : ' 16'
72+
73+ # ESLint and Prettier must be in `package.json`
74+ - run : yarn --frozen-lockfile --ignore-scripts
75+
76+ - run : yarn lint
0 commit comments