Skip to content

Merge pull request #5 from paluh/master #31

Merge pull request #5 from paluh/master

Merge pull request #5 from paluh/master #31

Workflow file for this run

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