Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate to spago@next #62

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ PG_DB="purspg"
PG_PORT=5432
# We want this setup so test runner disconnects quickly
PG_IDLE_TIMEOUT_MILLISECONDS=1000
PG_USER="mypguser"
PG_PASSWORD="mypgpass"

# You can provide additional options:
# PG_HOST ∷ String
Expand Down
34 changes: 27 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,45 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v2
- name: Set up a PureScript toolchain
uses: purescript-contrib/setup-purescript@main
with:
node-version: "18.x"
purescript: "latest"
purs-tidy: "latest"
spago: "unstable"

- name: Cache PureScript dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
key: ${{ runner.os }}-spago-${{ hashFiles('**/spago.lock') }}
path: |
.spago
output

- uses: actions/setup-node@v4
with:
node-version: "18.x"

- uses: KengoTODA/actions-setup-docker-compose@main
with:
version: "2.29.7" # the full version of `docker compose version` command

- name: Setup env
run: cp .env-ci .env

- name: Start postgres db for PG test
run: docker-compose up -d
run: docker compose up -d

- run: npm install
- run: npm run-script test
- run: npm run pretest

- name: Build source
run: spago build --censor-stats --strict --pedantic-packages

- name: Run tests
run: spago test --offline --censor-stats --strict --pedantic-packages -- --censor-codes=UserDefinedWarning

- name: Verify formatting
run: purs-tidy format-in-place test/Test/README.purs && purs-tidy check src test
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
/bower_components
/node_modules
/output
test/README.purs
package-lock.json
.env
/test/Test/README.purs
/package-lock.json
/.env
2 changes: 2 additions & 0 deletions .purs-repl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

import Prelude
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ all: build test

.PHONY: build
build: src/Database/PostgreSQL/Row.purs
pulp build
spago build

.PHONY: test
test: src/Database/PostgreSQL/Row.purs
pulp test
spago test

src/Database/PostgreSQL/Row.purs: Rows.pl
mkdir -p $(dir $@)
Expand Down
63 changes: 0 additions & 63 deletions bower.json

This file was deleted.

8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
version: "3"

# . ./.env && docker compose up
# or
# npm install -g @dotenvx/dotenvx
# dotenvx run -- docker compose up
services:
db:
image: postgres:12.5
image: postgres:latest
environment:
POSTGRES_DB: $PG_DB
POSTGRES_USER: $PG_USER
Expand Down
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
{
"name": "purescript-postgresql-client",
"dependencies": {
"decimal.js": "^10.0.0",
"pg": "^8.9.0",
"pg-native": "^3.0.1"
"decimal.js": "^10.4.3",
"pg": "^8.13.0",
"pg-native": "^3.2.0"
},
"devDependencies": {
"github-release-notes": "^0.17.1",
"paluh-litps": "^0.1.4",
"pulp": "^15.0.0",
"spago": "0.20.9",
"purescript": "0.15.7"
"github-release-notes": "^0.17.3",
"paluh-litps": "^0.1.4"
},
"scripts": {
"pretest": "paluh-litps compile --file README.md; mv README.purs test/README.purs",
"pretest": "paluh-litps compile --file README.md; mv README.purs test/Test/README.purs",
"test": "spago test"
}
}
106 changes: 0 additions & 106 deletions packages.dhall

This file was deleted.

53 changes: 0 additions & 53 deletions spago.dhall

This file was deleted.

Loading