-
Notifications
You must be signed in to change notification settings - Fork 115
30 lines (30 loc) · 932 Bytes
/
ci.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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: start X server
run: |
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
echo "DISPLAY=:99" >> $GITHUB_ENV
- uses: actions/checkout@v2
- run: npm ci
- run: npm test
- name: clang-format (diff)
if: github.event_name == 'pull_request'
env:
BASE: ${{ github['base_ref'] }}
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/$BASE:refs/remotes/origin/$BASE
npm run git-clang-format -- --diff origin/$BASE |\
awk -v s="^diff" '$0~s{r=1} 1; END{exit(r)}'
- name: clang-format (project)
if: github.event_name == 'push'
run: |
npm run git-clang-format -- --diff --commit $(git hash-object -t tree /dev/null) |\
awk -v s="^diff" '$0~s{r=1} 1; END{exit(r)}'