-
Notifications
You must be signed in to change notification settings - Fork 2
89 lines (73 loc) · 2.17 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on:
push:
branches: [master]
paths:
- 'example/**/*.purs'
- 'example/**/*.js'
- 'src/**/*.purs'
- 'src/**/*.js'
- 'test/**/*.purs'
- 'test/**/*.js'
- '*.json'
- '*.dhall'
- '.github/workflows/ci.yml'
pull_request:
branches: [master]
paths:
- 'example/**/*.purs'
- 'example/**/*.js'
- 'src/**/*.purs'
- 'src/**/*.js'
- 'test/**/*.purs'
- 'test/**/*.js'
- '*.json'
- '*.dhall'
- '.github/workflows/ci.yml'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up a PureScript toolchain
uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"
purs-tidy: "latest"
- name: Check formatting
run: purs-tidy check example src test
- name: Cache PureScript dependencies
uses: actions/cache@v2
with:
key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
path: |
.spago
output
- name: Cache Node.js dependencies
uses: actions/cache@v2
with:
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
path: node_modules
- name: Install PureScript dependencies
run: spago install
- name: Build source
run: spago build --no-install --purs-args '--censor-lib --strict'
- name: Install Node.js dependencies
run: npm ci
- name: Add Node.js dependencies to GITHUB_PATH
run: echo "$GITHUB_WORKSPACE/node_modules/.bin" >> $GITHUB_PATH
- name: Run tests
run: spago -x test.dhall test
- name: Verify Bower & Pulp
run: |
bower install
pulp build -- --censor-lib --strict
- name: Build example
run: spago -x example.dhall bundle-app --path example/Main.purs -m Example.Main -t public/example.js -y
- name: Publish example
if: github.event_name != 'pull_request'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public