-
Notifications
You must be signed in to change notification settings - Fork 39
59 lines (49 loc) · 1.5 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
57
58
59
name: CI
# CI is run on pull requests and on push to the main branch
on:
pull_request:
push:
branches: [ master, main ]
jobs:
test:
# This job is to run the tests
name: Run tests of elm-test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Run on Mac and Linux, for multiple Node versions
os: [macos-latest, ubuntu-latest]
node: ['8', '10', '12', '14']
env:
ELM_HOME: '${{ github.workspace }}/elm-home'
steps:
# Clone the repository
- uses: actions/checkout@v2
# Setup Node JS
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
# Install elm and cache ELM_HOME
- name: Install elm
uses: mpizenberg/[email protected]
with:
cache-key: tests-${{ matrix.os }}-node${{ matrix.node }}-0
cache-restore-key: tests-${{ matrix.os }}-node${{ matrix.node }}
- name: Run the tests
run: npm test
check_formatting:
# This job is to check the formatting of files
name: Check formatting
runs-on: ubuntu-latest
steps:
# Clone the repository
- uses: actions/checkout@v2
# Install elm-format
- name: Install elm-format
uses: mpizenberg/[email protected]
with:
cache-key: format-${{ matrix.os }}-node${{ matrix.node }}-0
cache-restore-key: format-${{ matrix.os }}-node${{ matrix.node }}
- name: Check formatting
run: npm run format