Skip to content

Commit 5b8f44a

Browse files
Update to 0.15; implement Node v14; use GH Actions (#7)
* Update to 0.15; implement Node v14; use GH Actions
1 parent 4818b13 commit 5b8f44a

File tree

14 files changed

+541
-399
lines changed

14 files changed

+541
-399
lines changed

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
3+
# Run CI when a PR is opened against the branch `master`
4+
# and when one pushes a commit to `master`.
5+
on:
6+
push:
7+
branches: [master]
8+
pull_request:
9+
branches: [master]
10+
11+
# Run CI on all 3 latest OSes
12+
jobs:
13+
build:
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, macOS-latest, windows-latest]
17+
runs-on: ${{ matrix.os }}
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- uses: purescript-contrib/setup-purescript@main
23+
with:
24+
purescript: "0.15.9"
25+
purs-tidy: "0.9.2"
26+
psa: "0.8.2"
27+
spago: "0.20.9"
28+
29+
- name: Cache PureScript dependencies
30+
uses: actions/cache@v2
31+
with:
32+
key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
33+
path: |
34+
.spago
35+
output
36+
37+
- name: Set up Node toolchain
38+
uses: actions/setup-node@v2
39+
with:
40+
node-version: "16"
41+
42+
- name: Cache NPM dependencies
43+
uses: actions/cache@v2
44+
env:
45+
cache-name: cache-node-modules
46+
with:
47+
path: ~/.npm
48+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
49+
restore-keys: |
50+
${{ runner.os }}-build-${{ env.cache-name }}-
51+
${{ runner.os }}-build-
52+
${{ runner.os }}-
53+
54+
# Compile the library/project
55+
# censor-lib: ignore warnings emitted by dependencies
56+
# strict: convert warnings into errors
57+
# Note: `purs-args` actually forwards these args to `psa`
58+
- name: Build the project
59+
run: |
60+
spago build --purs-args "--censor-lib --strict"
61+
62+
- name: Run tests
63+
run: |
64+
spago test
65+
66+
- name: Check Formatting
67+
if: runner.os == 'Linux'
68+
run: |
69+
purs-tidy check src test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
/output/
55
/.psc*
66
/.psa*
7+
.purs*
8+
/.spago/

.travis.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# purescript-node-os [![Build Status](https://travis-ci.org/Thimoteus/purescript-node-os.svg?branch=master)](https://travis-ci.org/Thimoteus/purescript-node-os)
1+
# purescript-node-os
22

33
Bindings for node's "os" module.
44

bower.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

generated-docs/Node/OS.md

Lines changed: 0 additions & 166 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 34 deletions
This file was deleted.

packages.dhall

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
let upstream =
2+
https://github.com/purescript/package-sets/releases/download/psc-0.15.8-20230607/packages.dhall
3+
sha256:31bf177700801a6fc8de6109009ba953e94329a5bb835350bea16b7b7f8dc479
4+
5+
in upstream

spago.dhall

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{ name = "node-os"
2+
, dependencies =
3+
[ "arrays"
4+
, "bifunctors"
5+
, "console"
6+
, "control"
7+
, "datetime"
8+
, "effect"
9+
, "either"
10+
, "exceptions"
11+
, "foldable-traversable"
12+
, "foreign"
13+
, "foreign-object"
14+
, "functions"
15+
, "maybe"
16+
, "node-buffer"
17+
, "nullable"
18+
, "partial"
19+
, "posix-types"
20+
, "prelude"
21+
, "unsafe-coerce"
22+
]
23+
, packages = ./packages.dhall
24+
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
25+
, license = "MIT"
26+
}

src/Node/Errors/SystemError.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const getField = (field, err) => err[field];
2+
export const getNullableField = (field, err) => err[field] ? err[field] : null;

0 commit comments

Comments
 (0)