Skip to content

Commit

Permalink
add CI (#17)
Browse files Browse the repository at this point in the history
* Add CI & Fix Tests

* fix peer dependencies

* no docs in ci, speed up with parallel
  • Loading branch information
mikearnaldi authored Feb 19, 2020
1 parent 8ac4f46 commit bdb6ffb
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 18 deletions.
1 change: 1 addition & 0 deletions .ci.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish CI

on:
push:
branches:
- master
- preview/*

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: npm install, build, and test
run: |
npm install -g lerna
npm install -g yarn
lerna bootstrap
lerna run build
lerna run prettier --parallel
lerna run lint --parallel
lerna run jest --parallel
cp .ci.npmrc .npmrc
lerna publish from-package --yes
env:
CI: 'true'
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test CI

on:
push:
branches:
- issue/**
- features/**
- generic/**

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: npm install, build, and test
run: |
npm install -g lerna
npm install -g yarn
lerna bootstrap
lerna run build
lerna run prettier --parallel
lerna run lint --parallel
lerna run jest --parallel
env:
CI: 'true'
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion packages/morphic-eq-interpreters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"newtype-ts": "^0.3.3"
},
"peerDependencies": {
"@morphic-ts/batteries": "^0.3.0",
"@morphic-ts/batteries": "^0.4.0",
"io-ts": "^2.0.6",
"io-ts-types": "^0.5.5",
"newtype-ts": "^0.3.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/morphic-fastcheck-interpreters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"newtype-ts": "^0.3.3"
},
"peerDependencies": {
"@morphic-ts/batteries": "^0.3.0",
"@morphic-ts/batteries": "^0.4.0",
"io-ts": "^2.0.6",
"io-ts-types": "^0.5.5",
"newtype-ts": "^0.3.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/morphic-io-ts-interpreters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"newtype-ts": "^0.3.3"
},
"peerDependencies": {
"@morphic-ts/batteries": "^0.3.0",
"@morphic-ts/batteries": "^0.4.0",
"io-ts": "^2.0.6",
"io-ts-types": "^0.5.5",
"newtype-ts": "^0.3.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import { some, none } from 'fp-ts/lib/Option'
import { either } from 'fp-ts'
import { pipe } from 'fp-ts/lib/pipeable'
import { Errors, Branded } from 'io-ts'
import { failure } from 'io-ts/lib/PathReporter'
import { summon, M } from '@morphic-ts/batteries/lib/summoner'
import { IoTsURI, iotsConfig } from '../src/index' // Fake to please the test runner
import { IoTsURI } from '../src/index' // Fake to please the test runner
import { modelIoTsStrictInterpreter } from '../src/interpreters' // Fake to please the test runner
import { withMessage } from 'io-ts-types/lib/withMessage'
export { IoTsURI, modelIoTsStrictInterpreter }

export type Tree = Node | Leaf
Expand Down
29 changes: 21 additions & 8 deletions packages/morphic-model-algebras/docs/modules/primitives.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,20 @@ export interface ModelAlgebraPrimitive<F> {
(config: ByInterp<PrimitiveStringConfig, URIS | URIS2>): HKT2<F, string, string>
}
stringLiteral: {
<T extends string>(value: T): isOptionalConfig<PrimitiveStringLiteralConfig, HKT2<F, string, typeof value>>
<T extends string>(value: T, config: ByInterp<PrimitiveStringLiteralConfig, URIS | URIS2>): HKT2<
<T extends string>(value: T): isOptionalConfig<PrimitiveStringLiteralConfig<T>, HKT2<F, string, typeof value>>
<T extends string>(value: T, config: ByInterp<PrimitiveStringLiteralConfig<T>, URIS | URIS2>): HKT2<
F,
string,
typeof value
>
}
keysOf: {
<K extends Keys>(keys: K): isOptionalConfig<PrimitiveKeysOfConfig, HKT2<F, string, keyof typeof keys>>
<K extends Keys>(keys: K, config: ByInterp<PrimitiveKeysOfConfig, URIS | URIS2>): HKT2<F, string, keyof typeof keys>
<K extends Keys>(keys: K): isOptionalConfig<PrimitiveKeysOfConfig<keyof K>, HKT2<F, string, keyof typeof keys>>
<K extends Keys>(keys: K, config: ByInterp<PrimitiveKeysOfConfig<keyof K>, URIS | URIS2>): HKT2<
F,
string,
keyof typeof keys
>
}
array: {
<L, A>(a: HKT2<F, L, A>): isOptionalConfig<PrimitiveArrayConfig<A>, HKT2<F, Array<L>, Array<A>>>
Expand All @@ -78,8 +82,11 @@ export interface ModelAlgebraPrimitive1<F extends URIS> {
number(config?: ByInterp<PrimitiveNumberConfig, F>): Kind<F, number>
bigint(config?: ByInterp<PrimitiveBigIntConfig, F>): Kind<F, bigint>
string(config?: ByInterp<PrimitiveStringConfig, F>): Kind<F, string>
stringLiteral: <T extends string>(value: T) => Kind<F, typeof value>
keysOf: <K extends Keys>(keys: K, config?: ByInterp<PrimitiveStringConfig, F>) => Kind<F, keyof typeof keys>
stringLiteral: <T extends string>(
value: T,
config?: ByInterp<PrimitiveStringLiteralConfig<T>, F>
) => Kind<F, typeof value>
keysOf: <K extends Keys>(keys: K, config?: ByInterp<PrimitiveKeysOfConfig<keyof K>, F>) => Kind<F, keyof typeof keys>
array: <A>(a: Kind<F, A>, config?: ByInterp<PrimitiveArrayConfig<A>, F>) => Kind<F, Array<A>>
date(config?: ByInterp<PrimitiveDateConfig, F>): Kind<F, Date>
}
Expand All @@ -99,8 +106,14 @@ export interface ModelAlgebraPrimitive2<F extends URIS2> {
number(config?: ByInterp<PrimitiveNumberConfig, F>): Kind2<F, number, number>
bigint(config?: ByInterp<PrimitiveBigIntConfig, F>): Kind2<F, string, bigint>
string(config?: ByInterp<PrimitiveStringConfig, F>): Kind2<F, string, string>
stringLiteral: <T extends string>(value: T) => Kind2<F, string, typeof value>
keysOf: <K extends Keys>(keys: K, config?: ByInterp<PrimitiveStringConfig, F>) => Kind2<F, string, keyof typeof keys>
stringLiteral: <T extends string>(
value: T,
config?: ByInterp<PrimitiveStringLiteralConfig<T>, F>
) => Kind2<F, string, typeof value>
keysOf: <K extends Keys>(
keys: K,
config?: ByInterp<PrimitiveKeysOfConfig<keyof K>, F>
) => Kind2<F, string, keyof typeof keys>
array: <L, A>(a: Kind2<F, L, A>, config?: ByInterp<PrimitiveArrayConfig2<L, A>, F>) => Kind2<F, Array<L>, Array<A>>
date(config?: ByInterp<PrimitiveDateConfig, F>): Kind2<F, string, Date>
}
Expand Down
11 changes: 9 additions & 2 deletions packages/morphic-model-algebras/src/primitives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ export interface ModelAlgebraPrimitive<F> {
}
keysOf: {
<K extends Keys>(keys: K): isOptionalConfig<PrimitiveKeysOfConfig<keyof K>, HKT2<F, string, keyof typeof keys>>
<K extends Keys>(keys: K, config: ByInterp<PrimitiveKeysOfConfig<keyof K>, URIS | URIS2>): HKT2<F, string, keyof typeof keys>
<K extends Keys>(keys: K, config: ByInterp<PrimitiveKeysOfConfig<keyof K>, URIS | URIS2>): HKT2<
F,
string,
keyof typeof keys
>
}
array: {
<L, A>(a: HKT2<F, L, A>): isOptionalConfig<PrimitiveArrayConfig<A>, HKT2<F, Array<L>, Array<A>>>
Expand Down Expand Up @@ -153,7 +157,10 @@ export interface ModelAlgebraPrimitive2<F extends URIS2> {
value: T,
config?: ByInterp<PrimitiveStringLiteralConfig<T>, F>
) => Kind2<F, string, typeof value>
keysOf: <K extends Keys>(keys: K, config?: ByInterp<PrimitiveKeysOfConfig<keyof K>, F>) => Kind2<F, string, keyof typeof keys>
keysOf: <K extends Keys>(
keys: K,
config?: ByInterp<PrimitiveKeysOfConfig<keyof K>, F>
) => Kind2<F, string, keyof typeof keys>
array: <L, A>(a: Kind2<F, L, A>, config?: ByInterp<PrimitiveArrayConfig2<L, A>, F>) => Kind2<F, Array<L>, Array<A>>
date(config?: ByInterp<PrimitiveDateConfig, F>): Kind2<F, string, Date>
}
2 changes: 1 addition & 1 deletion packages/morphic-ord-interpreters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"newtype-ts": "^0.3.3"
},
"peerDependencies": {
"@morphic-ts/batteries": "^0.3.0",
"@morphic-ts/batteries": "^0.4.0",
"io-ts": "^2.0.6",
"io-ts-types": "^0.5.5",
"newtype-ts": "^0.3.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/morphic-show-interpreters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"newtype-ts": "^0.3.3"
},
"peerDependencies": {
"@morphic-ts/batteries": "^0.3.0",
"@morphic-ts/batteries": "^0.4.0",
"io-ts": "^2.0.6",
"io-ts-types": "^0.5.5",
"newtype-ts": "^0.3.3"
Expand Down

0 comments on commit bdb6ffb

Please sign in to comment.