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
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: Fetch the PureScript compiler
- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: "22"

- name: Set up PureScript toolchain
uses: purescript-contrib/setup-purescript@2330ad9736aba56d65964a3335fe9368c9674db8
with:
psa: "0.9.0"
purescript: "0.15.15"
spago: "0.21.0"
spago: "1.0.3"

- name: Run exercism/purescript ci (runs tests) for all exercises
run: scripts/ci
12 changes: 5 additions & 7 deletions bin/update-exercises.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
#!/usr/bin/env bash

# This script will update spago.dhall and package.dhall of all exercises
# This script will update spago.yaml and .gitignore of all exercises
# using the master files from the project template (template/).

set -e
set -o pipefail
set -u

base_dir=$(builtin cd "${BASH_SOURCE%/*}/.." || exit; pwd)
exercises_dir="${base_dir}/exercises"
template_dir="${base_dir}/template"

for config in "$exercises_dir"/*/*/spago.dhall; do
exercise_dir=$(dirname "${config}")
slug=$(basename "${exercise_dir}")
for exercise_dir in "$base_dir"/exercises/*/*/; do
exercise_dir="${exercise_dir%/}"
slug="${exercise_dir##*/}"

echo "Working in ${exercise_dir}..."

sed -e "s/exercise-template/${slug}/" < "${template_dir}/spago.dhall" > "${exercise_dir}/spago.dhall"
cp "${template_dir}/packages.dhall" "${exercise_dir}/packages.dhall"
sed -e "s/exercise-template/${slug}/" < "${template_dir}/spago.yaml" > "${exercise_dir}/spago.yaml"
cp "${template_dir}/.gitignore" "${exercise_dir}/.gitignore"
done
3 changes: 1 addition & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
".meta/Exemplar.purs"
],
"invalidator": [
"packages.dhall",
"spago.dhall"
"spago.yaml"
]
},
"exercises": {
Expand Down
11 changes: 3 additions & 8 deletions exercises/concept/annalyns-infiltration/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
/bower_components/
/node_modules/
/.pulp-cache/
/output/
/generated-docs/
/.psc-package/
/.psc*
/.purs*
/.psa*
/.spago
/.spago/
/spago.lock
/.purs-repl
3 changes: 1 addition & 2 deletions exercises/concept/annalyns-infiltration/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
".meta/Exemplar.purs"
],
"invalidator": [
"packages.dhall",
"spago.dhall"
"spago.yaml"
]
},
"forked_from": [
Expand Down
5 changes: 0 additions & 5 deletions exercises/concept/annalyns-infiltration/.solution.dhall

This file was deleted.

5 changes: 0 additions & 5 deletions exercises/concept/annalyns-infiltration/packages.dhall

This file was deleted.

27 changes: 0 additions & 27 deletions exercises/concept/annalyns-infiltration/spago.dhall

This file was deleted.

32 changes: 32 additions & 0 deletions exercises/concept/annalyns-infiltration/spago.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package:
name: annalyns-infiltration
dependencies:
- arrays
- console
- datetime
- effect
- either
- enums
- exceptions
- foldable-traversable
- integers
- lists
- maybe
- numbers
- ordered-collections
- partial
- prelude
- psci-support
- st
- strings
- test-unit
- tuples
- unfoldable
- unicode
test:
main: Test.Main
dependencies: []
workspace:
packageSet:
registry: 73.0.0
extraPackages: {}
11 changes: 3 additions & 8 deletions exercises/practice/accumulate/.gitignore
Copy link
Member

Choose a reason for hiding this comment

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

Why is there a per-exercise .gitignore vs a common one at the root?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's a good idea to have exercise-scoped .gitignore because if someone downloads an independent exercise, we don't know what context it might exist in, as someone could want to work on an exercise within their own Git repo, so being self-contained guarantees that the right things will be ignored.

BTW, this PR is a mess because I screwed things up, so I'm preparing to address other stuff and create a new PR when I'm ready.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I meant, the test runner one, where I have a new one exercism/purescript-test-runner#64

Copy link
Member

Choose a reason for hiding this comment

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

None (or very few) of the other tracks use per-exercise .gitignores. If the user is checking in their code, would it make sense to let them manage their own .gitignore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do think packaging directories with their own scoped .gitignore is the best way to go, and that it's a mistake that it's not a standard practice throughout Exercism.

Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
/bower_components/
/node_modules/
/.pulp-cache/
/output/
/generated-docs/
/.psc-package/
/.psc*
/.purs*
/.psa*
/.spago
/.spago/
/spago.lock
/.purs-repl
3 changes: 1 addition & 2 deletions exercises/practice/accumulate/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"examples/src/Accumulate.purs"
],
"invalidator": [
"packages.dhall",
"spago.dhall"
"spago.yaml"
]
},
"blurb": "Implement the `accumulate` operation, which, given a collection and an operation to perform on each element of the collection, returns a new collection containing the result of applying that operation to each element of the input collection.",
Expand Down
5 changes: 0 additions & 5 deletions exercises/practice/accumulate/.solution.dhall

This file was deleted.

5 changes: 0 additions & 5 deletions exercises/practice/accumulate/packages.dhall

This file was deleted.

27 changes: 0 additions & 27 deletions exercises/practice/accumulate/spago.dhall

This file was deleted.

32 changes: 32 additions & 0 deletions exercises/practice/accumulate/spago.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package:
name: accumulate
dependencies:
- arrays
- console
- datetime
- effect
- either
- enums
- exceptions
- foldable-traversable
- integers
- lists
- maybe
- numbers
- ordered-collections
- partial
- prelude
- psci-support
- st
- strings
- test-unit
- tuples
- unfoldable
- unicode
test:
main: Test.Main
dependencies: []
workspace:
packageSet:
registry: 73.0.0
extraPackages: {}
11 changes: 3 additions & 8 deletions exercises/practice/acronym/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
/bower_components/
/node_modules/
/.pulp-cache/
/output/
/generated-docs/
/.psc-package/
/.psc*
/.purs*
/.psa*
/.spago
/.spago/
/spago.lock
/.purs-repl
3 changes: 1 addition & 2 deletions exercises/practice/acronym/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"examples/src/Acronym.purs"
],
"invalidator": [
"packages.dhall",
"spago.dhall"
"spago.yaml"
]
},
"blurb": "Convert a long phrase to its acronym.",
Expand Down
5 changes: 0 additions & 5 deletions exercises/practice/acronym/.solution.dhall

This file was deleted.

5 changes: 0 additions & 5 deletions exercises/practice/acronym/packages.dhall

This file was deleted.

27 changes: 0 additions & 27 deletions exercises/practice/acronym/spago.dhall

This file was deleted.

32 changes: 32 additions & 0 deletions exercises/practice/acronym/spago.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package:
name: acronym
dependencies:
- arrays
- console
- datetime
- effect
- either
- enums
- exceptions
- foldable-traversable
- integers
- lists
- maybe
- numbers
- ordered-collections
- partial
- prelude
- psci-support
- st
- strings
- test-unit
- tuples
- unfoldable
- unicode
test:
main: Test.Main
dependencies: []
workspace:
packageSet:
registry: 73.0.0
extraPackages: {}
11 changes: 3 additions & 8 deletions exercises/practice/all-your-base/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
/bower_components/
/node_modules/
/.pulp-cache/
/output/
/generated-docs/
/.psc-package/
/.psc*
/.purs*
/.psa*
/.spago
/.spago/
/spago.lock
/.purs-repl
3 changes: 1 addition & 2 deletions exercises/practice/all-your-base/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"examples/src/AllYourBase.purs"
],
"invalidator": [
"packages.dhall",
"spago.dhall"
"spago.yaml"
]
},
"blurb": "Convert a number, represented as a sequence of digits in one base, to any other base."
Expand Down
5 changes: 0 additions & 5 deletions exercises/practice/all-your-base/.solution.dhall

This file was deleted.

5 changes: 0 additions & 5 deletions exercises/practice/all-your-base/packages.dhall

This file was deleted.

Loading