-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (35 loc) · 1.26 KB
/
checkin.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
name: PR Checks
on: [pull_request, push]
jobs:
check_pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Cache node modules
id: cache-npm
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-npm-${{ env.cache-name }}-
${{ runner.OS }}-npm-
${{ runner.OS }}-
- if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm install
- run: npm run build
- name: check for uncommitted changes
# Ensure no changes, but ignore node_modules dir since dev/fresh ci deps installed.
run: |
git diff --exit-code --stat -- . ':!node_modules' \
|| (git diff -- . ':!node_modules') \
|| (echo "##[error] found changed files after build. please 'npm run build && npm run format'" \
"and check in all changes" \
&& exit 1)
- uses: indentinc/github-action-slack-notify@master
with:
status: ${{ job.status }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()