diff --git a/README.md b/README.md index 5e64e82..7612c85 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,7 @@ All exercises live in `exercises` folder. Here's the standard folder structure: │ └─ .purs ├─ test │ └─ Main.purs -├─ packages.dhall -└─ spago.dhall +└─ spago.yaml ``` Creating a new exercise requires modification to: @@ -54,9 +53,8 @@ Creating a new exercise requires modification to: The remaining files: - `test/Main.purs` - contains tests -- `spago.dhall` and `packages.dhall` - these are copied from the template - project `template/*.dhall` and should not be directly modified (see the - following section) +- `spago.yaml` - copied from the template project and should not be directly + modified (see the following section) #### Steps for adding a new exercise @@ -68,7 +66,7 @@ The remaining files: - Add exercise details to `config.json` - Add tests to `test/Main.purs` - Add your solution to `examples/src/.purs` -- Run `bin/test.sh` to make sure all tests pass +- Run `scripts/ci` to make sure all tests pass - Commit, push and make a pull request - Check that GitHub CI passes diff --git a/bin/test-separate.sh b/bin/test-separate.sh deleted file mode 100755 index fe26882..0000000 --- a/bin/test-separate.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash - -xpurescript=$(dirname "$BASH_SOURCE") -xpurescript=$(cd "$xpurescript/.." && pwd -P) -cd "$xpurescript/exercises" - -# Calling the script with 'clean' as the first argument -# will cause a fully clean build - -clean=no -if [[ "$1" == clean ]]; then - clean=yes -fi - -# Run for all exercises - -for exercise in *; do - if [[ -f $exercise/bower.json ]]; then - cd $exercise - - echo - echo -e "\e[1;32m--- [ $exercise ]\e[0;39m" - echo - - # Clean local caches if clean build was requested - if [[ $clean == yes ]]; then - rm -rf bower_components output .pulp-cache - fi - - # Move the example solution temporarily - if [[ ! -d src.tmp ]]; then - mv src src.tmp - mv examples/src src - fi - - # Install and test - bower install - pulp test - - # Revert to the previous state - mv src examples/src - mv src.tmp src - - cd .. - fi -done diff --git a/bin/test.sh b/bin/test.sh deleted file mode 100755 index dbdd46c..0000000 --- a/bin/test.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env bash - -xpurescript=$(dirname "$BASH_SOURCE") -xpurescript=$(cd "$xpurescript/.." && pwd -P) -cd "$xpurescript" - -# Prepare the work directory - -work_dir="$xpurescript/.work" - -mkdir -p $work_dir - -# Clean up if this is used locally (not on Travis) - -if [[ -z "$TRAVIS" ]]; then - rm $work_dir/bower.json - rm -f $work_dir/src/*.purs - rm -f $work_dir/test/*.purs -fi - -for dir in src test; do - mkdir -p $work_dir/$dir -done - -# Copy the exercises, tests and common bower.json - -cp etc/bower.json $work_dir -cp exercises/*/examples/src/*.purs $work_dir/src - -for exercise_full in exercises/*; do - exercise=$(basename $exercise_full) - module=$(basename $exercise_full/examples/src/*.purs) - - cp exercises/$exercise/test/Main.purs $work_dir/test/$module -done - -# List for troubleshooting purposes - -cd $work_dir - -for f in bower.json src test; do - echo - echo -e "\e[1;32m--- [ $f ]\e[0;39m" - echo - - ls --color -l $f -done - -# Create Test.Main and update exercise test modules - -cd $xpurescript - -node etc/test-main-maker.js $work_dir/test -node etc/test-module-updater.js $work_dir/test - -# Install bower dependencies, build and test - -cd $work_dir - -time bower install - -time pulp test - -test_result=$? - -# Report the results - -echo -if [[ $test_result == 0 ]]; then - echo -e "\e[1;32m[ All tests have passed ]\e[0;39m" -else - echo -e "\e[1;31m[ Some tests have failed ]\e[0;39m" -fi - -exit $test_result diff --git a/reference/implementing-a-concept-exercise.md b/reference/implementing-a-concept-exercise.md index 5ce36e4..f34b1aa 100644 --- a/reference/implementing-a-concept-exercise.md +++ b/reference/implementing-a-concept-exercise.md @@ -45,8 +45,8 @@ languages ├── src | └── .purs ├── test - | └── Test.purs - └── bower.json + | └── Main.purs + └── spago.yaml ## Step 1: Add code files @@ -54,8 +54,8 @@ languages These are files specific to the PureScript track: - `src/.purs`: the stub implementation file, which is the starting point for students to work on the exercise. -- `test/Test.purs`: the test suite. -- `bower.json`: the bower project file. +- `test/Main.purs`: the test suite. +- `spago.yaml`: the Spago project configuration. - `.meta/Exemplar.purs`: an exemplar implementation that passes all the tests. ## Step 2: Add documentation files