-
Notifications
You must be signed in to change notification settings - Fork 939
55 lines (44 loc) · 1.35 KB
/
ci.yaml
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
name: Node.js CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 22.x]
env:
FAIL_IF_DIST_MESSAGE: "These files are autogenerated. Please don't include changes to these files in your PR"
# Set the timezone to Eastern Standard Time since that is what the library expects
TZ: "America/New_York"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build
- name: Run tests
run: npm run coverage
- name: Run Coveralls
run: npm run coveralls
- name: Check for changed dist files
run: |
git fetch origin main --depth=1
# Check for changes in dist files, using grep's exit status directly
DIST_CHANGED=$(git diff --name-only HEAD origin/main | grep 'rickshaw\(\.min\)\?\.\(js\|css\)' || true)
if [ -n "$DIST_CHANGED" ]; then
echo -e "\033[31m${{ env.FAIL_IF_DIST_MESSAGE }}"
echo -e "\033[31mChanged files:"
echo "$DIST_CHANGED"
exit 1
fi