GithubHelp home page GithubHelp logo

nwolverson / setup-purescript Goto Github PK

View Code? Open in Web Editor NEW

This project forked from purescript-contrib/setup-purescript

0.0 2.0 0.0 736 KB

Set up a specific PureScript toolchain in your GitHub Actions workflow

License: MIT License

JavaScript 0.67% Dhall 3.82% Nix 3.03% PureScript 92.48%

setup-purescript's Introduction

Setup PureScript Action

Integration Sync Versions Maintainer: thomashoneyman

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 PureScript tools. 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.

Usage

See the action.yml file for all possible inputs and outputs.

Basic

Use the PureScript toolchain with the latest versions of PureScript and Spago:

steps:
  - uses: actions/checkout@v2
  - uses: purescript-contrib/setup-purescript@main
  - run: spago build

Other tools are not enabled by default, but you can enable them by specifying their version.

Specify Versions

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: purescript-contrib/setup-purescript@main
    with:
      purescript: "0.14.0"
      psa: "0.8.2"
      spago: "latest"
      purs-tidy: "latest"
      zephyr: "0.3.2"
  - run: spago build

Full Example Workflow

This 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: purescript-contrib/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-install

Development

Enter a development shell with necessary tools installed:

nix-shell

If 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 install

GitHub 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 build

This will bundle and minify the source code so it is available to the end user.

Used By

These libraries and applications are examples of setup-purescript in action:

setup-purescript's People

Contributors

actions-user avatar thomashoneyman avatar th-awake avatar triallax avatar nwolverson avatar dependabot[bot] avatar milesfrain avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.