Skip to content

Commit 4244e16

Browse files
Add CI
1 parent f0dff81 commit 4244e16

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI
2+
3+
# Run CI when a PR is opened against the branch `master`
4+
# and when one pushes a commit to `master`.
5+
on:
6+
push:
7+
branches: [master]
8+
pull_request:
9+
branches: [master]
10+
11+
# Run CI on all 3 latest OSes
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Node toolchain
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: "16"
23+
24+
- name: Cache NPM dependencies
25+
uses: actions/cache@v3
26+
env:
27+
cache-name: cache-node-modules
28+
with:
29+
path: ~/.npm
30+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
31+
restore-keys: |
32+
${{ runner.os }}-build-${{ env.cache-name }}-
33+
${{ runner.os }}-build-
34+
${{ runner.os }}-
35+
36+
- name: Setup PureScript tooling
37+
run:
38+
npm i -g purescript@latest purs-tidy@latest purescript-psa@latest spago@latest
39+
40+
- name: Cache PureScript dependencies
41+
uses: actions/cache@v3
42+
with:
43+
key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
44+
path: |
45+
.spago
46+
output
47+
48+
# Compile the library/project
49+
# censor-lib: ignore warnings emitted by dependencies
50+
# strict: convert warnings into errors
51+
# Note: `purs-args` actually forwards these args to `psa`
52+
- name: Build the project
53+
run: |
54+
npx spago build --purs-args "--censor-lib --strict"
55+
56+
- name: Check Formatting
57+
if: runner.os == 'Linux'
58+
run: |
59+
npx purs-tidy check src
60+

0 commit comments

Comments
 (0)