A GitHub Action which sets up a PureScript toolchain for CI. Contains the following tools by default:
You can also optionally include the following tools:
This action is designed to support tools with static binaries. Your PureScript project may also depend on tooling and libraries provided by the NPM ecosystem, in which case you will also want to use the setup-node action.
See the action.yml file for all possible inputs and outputs.
Use the PureScript toolchain with the latest versions of PureScript and Spago:
steps:
- uses: actions/checkout@v2
- uses: thomashoneyman/setup-purescript@main
- run: spago buildOther tools are not enabled by default, but you can enable them by specifying their version.
Each tool can accept a semantic version (only exact versions currently supported) or the string "latest". Tools that are not installed by default must be specified this way to be included in the toolchain.
steps:
- uses: actions/checkout@v2
- uses: thomashoneyman/setup-purescript@main
with:
purescript: "0.13.8"
spago: "0.15.3"
purty: "latest"
zephyr: "0.3.2"
- run: spago buildThis workflow is a useful starting point for new projects and libraries. You can add a .yml file with the contents below to the .github/workflows directory in your project (for example: .github/workflows/ci.yml).
name: CI
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: thomashoneyman/setup-purescript@main
- name: Cache PureScript dependencies
uses: actions/cache@v2
# This cache uses the .dhall files to know when it should reinstall
# and rebuild packages. It caches both the installed packages from
# the `.spago` directory and compilation artifacts from the `output`
# directory. When restored the compiler will rebuild any files that
# have changed. If you do not want to cache compiled output, remove
# the `output` path.
with:
key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
path: |
.spago
output
- run: spago build
- run: spago test --no-installEnter a development shell with necessary tools installed:
nix-shellIf you need any additional tools not included in this Nix expression or available via NPM, please feel free to add them via easy-purescript-nix.
Next, install NPM dependencies:
npm installGitHub Actions uses the action.yml file to define the action and the dist/index.js file to execute it. After making any changes to the source code, make sure those changes are visible by running:
npm run packageThis will bundle and minify the source code so it is available to the end user.