git.iko.soy/rowtype-yoga/purescript-yoga-actions
on main help sign in
Revert "Drop Node.js entirely! Use 'bunx spago' to run with Bun runtime"
4784fd1Mark
.github/actions/setup/action.yml+9
unifiedsplit
@@ -25,6 +25,11 @@ inputs:
25runs:
25runs:
26 using: 'composite'
26 using: 'composite'
27 steps:
27 steps:
28+ - name: Setup Node.js 22 (required for Spago's node:sqlite)
29+ uses: actions/setup-node@v4
30+ with:
31+ node-version: '22'
32+
28 - name: Setup Bun
33 - name: Setup Bun
29 uses: oven-sh/setup-bun@v1
34 uses: oven-sh/setup-bun@v1
30 with:
35 with:
@@ -34,6 +39,10 @@ runs:
34 shell: bash
39 shell: bash
35 run: bun install --global purescript@${{ inputs.purescript-version }}
40 run: bun install --global purescript@${{ inputs.purescript-version }}
36
41
42+ - name: Install Spago
43+ shell: bash
44+ run: bun install --global spago@${{ inputs.spago-version }}
45+
37 - name: Install dependencies
46 - name: Install dependencies
38 if: inputs.install-deps == 'true'
47 if: inputs.install-deps == 'true'
39 shell: bash
48 shell: bash
README.md+16−14
@@ -7,10 +7,10 @@ Reusable GitHub Actions for PureScript Yoga packages.
7### `setup` - Complete PureScript Yoga Stack Setup
7### `setup` - Complete PureScript Yoga Stack Setup
8
8
9Sets up everything needed to build and test PureScript Yoga packages:
9Sets up everything needed to build and test PureScript Yoga packages:
10+- Node.js 22+ (required for Spago's `node:sqlite` dependency)
10−- Bun (JavaScript runtime + fast package manager)
11+- Bun (for fast package installation)
11- PureScript compiler
12- PureScript compiler
12−
13+- Spago package manager
13−**Note**: Use `bunx spago` instead of `spago` in your workflows to run Spago with Bun's runtime.
14
14
15#### Usage
15#### Usage
16
16
@@ -21,9 +21,11 @@ Sets up everything needed to build and test PureScript Yoga packages:
21#### With Custom Versions
21#### With Custom Versions
22
22
23```yaml
23```yaml
24−- uses: rowtype-yoga/purescript-yoga-actions/.github/actions/setup@main
24+- uses: rowtype-yoga/purescript-yoga-actions/setup@main
25 with:
25 with:
26 purescript-version: '0.15.15'
26 purescript-version: '0.15.15'
27+ spago-version: 'unstable'
28+ node-version: '22'
27 bun-version: 'latest'
29 bun-version: 'latest'
28 install-deps: 'true'
30 install-deps: 'true'
29```
31```
@@ -33,6 +35,7 @@ Sets up everything needed to build and test PureScript Yoga packages:
33| Input | Description | Default |
35| Input | Description | Default |
34|-------|-------------|---------|
36|-------|-------------|---------|
35| `purescript-version` | PureScript compiler version | `0.15.15` |
37| `purescript-version` | PureScript compiler version | `0.15.15` |
38+| `spago-version` | Spago version (`latest` or semver) | `latest` |
36| `bun-version` | Bun version | `latest` |
39| `bun-version` | Bun version | `latest` |
37| `install-deps` | Auto-run `bun install` | `true` |
40| `install-deps` | Auto-run `bun install` | `true` |
38
41
@@ -66,9 +69,9 @@ jobs:
66 runs-on: ubuntu-latest
69 runs-on: ubuntu-latest
67 steps:
70 steps:
68 - uses: actions/checkout@v4
71 - uses: actions/checkout@v4
69− - uses: rowtype-yoga/purescript-yoga-actions/.github/actions/setup@main
72+ - uses: rowtype-yoga/purescript-yoga-actions/setup@main
70− - run: bunx spago build
73+ - run: spago build
71− - run: bunx spago test
74+ - run: spago test
72```
75```
73
76
74### With Redis Service
77### With Redis Service
@@ -95,16 +98,15 @@ jobs:
95
98
96 steps:
99 steps:
97 - uses: actions/checkout@v4
100 - uses: actions/checkout@v4
98− - uses: rowtype-yoga/purescript-yoga-actions/.github/actions/setup@main
101+ - uses: rowtype-yoga/purescript-yoga-actions/setup@main
99− - run: bunx spago test
102+ - run: spago test
100```
103```
101
104
102−## Why Bun?
105+## Why Node 22 + Bun?
106+
107+**Node.js 22** is required because Spago 1.x uses the `node:sqlite` built-in module (only available in Node 22+). When you run `spago`, it executes with the system Node.js.
103
108
104−**Bun** is a fast all-in-one JavaScript runtime that:
109+**Bun** is used for incredibly fast npm package installation (`bun install` is much faster than `npm install`).
105−- Can run Spago 1.x (including its `node:sqlite` dependency) via `bunx`
106−- Provides incredibly fast package installation
107−- No separate Node.js installation needed!
108
110
109## License
111## License
110
112