-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.82 KB
/
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
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup Node.js environment
uses: actions/setup-node@v1
- name: Cache node_modules
id: internal-cache-node_modules
uses: actions/cache@v2
with:
path: node_modules
key: internal-node_modules-ubuntu-latest.x-${{ hashFiles('package-lock.json') }}
- name: Cache ~/.elm
uses: actions/cache@v2
with:
path: ~/.elm
key: elm-${{ hashFiles('elm.json', 'elm-tooling.json', 'review/elm.json') }}
- name: Install npm dependencies
if: steps.cache-node_modules.outputs.cache-hit != 'true'
env:
# If you have a `"postinstall": "elm-tooling install"` script in your
# package.json, this turns it into a no-op. We’ll run it in the next
# step because of the caching. If elm-tooling.json changes but
# package-lock.json does not, the postinstall script needs running
# but this step won’t.
NO_ELM_TOOLING_INSTALL: 1
run: npm ci
# Install tools from elm-tooling.json, unless we restored them from
# cache. package-lock.json and elm-tooling.json can change independently,
# so we need to install separately based on what was restored from cache.
# This is run even if we restored ~/.elm from cache to be 100% sure
# node_modules/.bin/ contains links to all your tools. `elm-tooling
# install` runs very fast when there’s nothing new to download so
# skipping the step doesn’t save much time.
- name: elm-tooling install
run: npx --no-install elm-tooling install
- name: Run tests
run: npm test