Skip to content
Merged
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
33 changes: 17 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- 'test/**/*.purs'
- 'test/**/*.js'
- '*.json'
- '*.dhall'
- '**/spago.yaml'
- 'scripts/check-docs.mjs'
- 'scripts/check-examples.mjs'
- '.github/workflows/ci.yml'
Expand All @@ -27,7 +27,7 @@ on:
- 'test/**/*.purs'
- 'test/**/*.js'
- '*.json'
- '*.dhall'
- '**/spago.yaml'
- 'scripts/check-docs.mjs'
- 'scripts/check-examples.mjs'
- '.github/workflows/ci.yml'
Expand All @@ -41,34 +41,41 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 22

- name: Set up a PureScript toolchain
uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"
purs-tidy: "latest"

- name: Install Spago
run: npm install -g spago@1.0.5

- 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.yaml') }}
path: |
.spago
output

- name: Cache NPM dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
path: node_modules

- name: Install PureScript dependencies
run: spago install
run: spago fetch

- name: Build source
run: spago build --no-install --purs-args '--censor-lib --strict'
run: spago build -p tecton --strict

- name: Run tests
run: spago -x test.dhall test
run: spago test -p tecton

- name: Check formatting
run: purs-tidy check examples src test
Expand All @@ -82,12 +89,6 @@ jobs:
- name: Check docs
run: npm run check-docs

- name: Verify Bower & Pulp
run: |
npm install bower pulp@16.0.0-0
npx bower install
npx pulp build -- --censor-lib --strict

- if: github.ref == 'refs/heads/master'
name: Dispatch tecton-halogen CI
run: |
Expand All @@ -99,7 +100,7 @@ jobs:
- if: github.ref == 'refs/heads/master'
id: count
name: Get test count
run: echo "value=$(spago -x test.dhall test | grep Summary -A1 | tail -n 1 | cut -d "/" -f2 | cut -d " " -f1)" >> $GITHUB_OUTPUT
run: echo "value=$(spago test -p tecton | grep Summary -A1 | tail -n 1 | cut -d "/" -f2 | cut -d " " -f1)" >> $GITHUB_OUTPUT

- if: github.ref == 'refs/heads/master'
name: Update test count data
Expand Down Expand Up @@ -129,4 +130,4 @@ jobs:
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book
publish_dir: ./book
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
/.purs*
/.psa*
/.spago
/spago.lock
5 changes: 0 additions & 5 deletions example.dhall

This file was deleted.

6 changes: 6 additions & 0 deletions examples/spago.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package:
name: tecton-examples
dependencies:
- console: ">=6.0.0 <7.0.0"
- effect: ">=4.0.0 <5.0.0"
- tecton: "*"
5 changes: 0 additions & 5 deletions packages.dhall

This file was deleted.

7 changes: 4 additions & 3 deletions scripts/check-examples.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from "path";
import { execa } from "execa";
import { diffLines } from "diff";

for (let x of ["examples", "example.dhall"]) {
for (let x of ["examples", "examples/spago.yaml"]) {
try {
await fs.access(x);
}
Expand Down Expand Up @@ -32,7 +32,8 @@ for (let example of examples) {
}
catch {}

const { stdout: actual } = await execa("spago", ["-x", "example.dhall", "run", "-p", path.join(examplesDir, `${example}.purs`), "-m", `Example.${example}`]);
await execa("spago", ["build", "-p", "tecton-examples", "--purs-args", path.join(examplesDir, `${example}.purs`)]);
const { stdout: actual } = await execa("node", ["--input-type=module", "-e", `import { main } from './output/Example.${example}/index.js'; main();`]);

const needsUpdate = updateFlag || !expected;

Expand Down Expand Up @@ -69,7 +70,7 @@ const typeErrors = typeErrorsListing.flatMap(x => x.match(/^[A-Za-z]+(?=\.purs$)

for (let typeError of typeErrors) {
try {
await execa("spago", ["build", "-p", path.join(typeErrorsDir, `${typeError}.purs`)]);
await execa("spago", ["build", "-p", "tecton", "--purs-args", path.join(typeErrorsDir, `${typeError}.purs`)]);
process.stdout.write(chalk.red(`✗ TypeError.${typeError} compiled successfully.\n`));
process.exit(1);
}
Expand Down
20 changes: 0 additions & 20 deletions spago.dhall

This file was deleted.

28 changes: 28 additions & 0 deletions spago.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package:
name: tecton
publish:
version: 0.2.2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With spago.yaml, the release version needs to be specified in the manifest. I’ve proposed a patch version here, so after merging you can tag this commit as v0.2.2. Of course you can also change it if you want to release as a different version!

license: MIT
location:
githubOwner: nsaunders
githubRepo: purescript-tecton
dependencies:
- colors: ">=7.0.1 <8.0.0"
- either: ">=6.0.0 <7.0.0"
- foldable-traversable: ">=6.0.0 <7.0.0"
- integers: ">=6.0.0 <7.0.0"
- lists: ">=7.0.0 <8.0.0"
- numbers: ">=9.0.0 <10.0.0"
- prelude: ">=6.0.0 <7.0.0"
- record: ">=4.0.0 <5.0.0"
- strings: ">=6.0.0 <7.0.0"
- transformers: ">=6.0.0 <7.0.0"
- tuples: ">=7.0.0 <8.0.0"
- web-html: ">=4.0.0 <5.0.0"
test:
main: Test.Main
dependencies:
- aff: ">=7.0.0 <8.0.0"
- effect: ">=4.0.0 <5.0.0"
- spec: ">=7.0.0 <8.0.0"
workspace: {}
6 changes: 0 additions & 6 deletions test.dhall

This file was deleted.

Loading