Skip to content

Commit 32fa32c

Browse files
Add purescript-psa to the supported tools (#3)
1 parent e53c99c commit 32fa32c

18 files changed

+264
-203
lines changed

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ jobs:
2121
- name: Check tools are installed correctly
2222
run: |
2323
purty src/Main.purs
24-
spago build --purs-args '--codegen corefn,js'
24+
spago build --purs-args '--censor-lib --strict --codegen corefn,js'
2525
zephyr -f Main.main

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ A GitHub Action which sets up a PureScript toolchain for CI. Contains the follow
66

77
- The [PureScript compiler](https://github.com/purescript/purescript)
88
- The [Spago package manager and build tool](https://github.com/purescript/spago)
9+
- The [`psa` error reporting frontend for the compiler](https://github.com/natefaubion/purescript-psa)
910

1011
You can also optionally include the following tools:
1112

1213
- The [Zephyr dead code elimination tool](https://github.com/coot/zephyr)
1314
- The [Purty source code formatter](https://gitlab.com/joneshf/purty)
1415

15-
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](https://github.com/actions/setup-node) action.
16+
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](https://github.com/actions/setup-node) action.
1617

1718
## Usage
1819

@@ -41,6 +42,7 @@ steps:
4142
- uses: thomashoneyman/setup-purescript@main
4243
with:
4344
purescript: "0.13.8"
45+
psa: "0.7.2"
4446
spago: "0.15.3"
4547
purty: "latest"
4648
zephyr: "0.3.2"
@@ -61,7 +63,7 @@ jobs:
6163
runs-on: ubuntu-latest
6264
steps:
6365
- uses: actions/checkout@v2
64-
66+
6567
- uses: thomashoneyman/setup-purescript@main
6668
6769
- name: Cache PureScript dependencies
@@ -102,7 +104,7 @@ npm install
102104
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:
103105

104106
```sh
105-
npm run package
107+
npm run build
106108
```
107109

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

action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ inputs:
88
spago:
99
description: "The Spago version to install. Examples: latest, 0.15.3"
1010
default: "latest"
11+
psa:
12+
description: "The psa version to install. Examples: latest, 0.7.2"
13+
default: "latest"
1114
purty:
1215
description: "The Purty version to install. Examples: latest, 6.2.0"
1316
zephyr:
@@ -16,5 +19,5 @@ runs:
1619
using: "node12"
1720
main: "dist/index.js"
1821
branding:
19-
icon: 'download'
20-
color: 'gray-dark'
22+
icon: "download"
23+
color: "gray-dark"

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/update.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/versions.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
{"purs":"0.13.8","spago":"0.15.3","purty":"6.2.0","zephyr":"0.3.2"}
1+
{
2+
"purs": "0.13.8",
3+
"spago": "0.15.3",
4+
"psa": "0.7.3",
5+
"purty": "6.2.0",
6+
"zephyr": "0.3.2"
7+
}

package-lock.json

Lines changed: 10 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@
33
"description": "Set up a PureScript toolchain in GitHub Actions",
44
"author": "Thomas Honeyman",
55
"license": "MIT",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/thomashoneyman/setup-purescript.git"
9+
},
610
"scripts": {
7-
"package": "spago bundle-module --to output/index.js && ncc build --minify update.js && mv dist/index.js dist/update.js && ncc build --minify index.js"
11+
"build": "spago bundle-module --to output/index.js && ncc build --minify update.js && mv dist/index.js dist/update.js && ncc build --minify index.js"
812
},
913
"dependencies": {
1014
"@actions/core": "^1.2.4",
15+
"@actions/exec": "^1.0.4",
1116
"@actions/tool-cache": "^1.6.0",
1217
"xhr2": "^0.2.0"
1318
},
1419
"devDependencies": {
15-
"@zeit/ncc": "^0.22.3"
20+
"@vercel/ncc": "^0.23.0"
1621
}
1722
}

src/Actions/Exec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const exec = require("@actions/exec");
2+
3+
exports.execImpl = exec.exec;

src/Actions/Exec.purs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-- | Exports functions from the @actions/exec module provided by GitHub
2+
-- | https://github.com/actions/toolkit/tree/main/packages/exec
3+
module Actions.Exec
4+
( exec
5+
) where
6+
7+
import Prelude
8+
9+
import Control.Promise (Promise, toAffE)
10+
import Effect.Aff (Aff)
11+
import Effect.Uncurried (EffectFn2, runEffectFn2)
12+
13+
foreign import execImpl :: EffectFn2 String (Array String) (Promise Number)
14+
15+
-- | Executes a command on the command line, with arguments
16+
exec :: String -> Array String -> Aff { succeeded :: Boolean }
17+
exec command args =
18+
map ((_ == 0.0) >>> { succeeded: _ })
19+
$ toAffE
20+
$ runEffectFn2 execImpl command args

0 commit comments

Comments
 (0)