mirror of
https://github.com/correl/elm.git
synced 2024-11-14 19:19:29 +00:00
Ensure individual exercise elm-package.json files are tested in CI
Also removes need to manage a centralized elm-package.json
This commit is contained in:
parent
6987b636ad
commit
2ff013304a
4 changed files with 9 additions and 99 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -7,3 +7,4 @@ elm-stuff
|
|||
CHECKLIST
|
||||
build.js
|
||||
node_modules
|
||||
build
|
||||
|
|
18
bin/build.sh
18
bin/build.sh
|
@ -33,32 +33,30 @@ fi
|
|||
declare -i TEST_RESULT=0
|
||||
FAILED_EXERCISES=''
|
||||
|
||||
mkdir -p build/tests
|
||||
|
||||
for example_file in exercises/**/*.example.elm
|
||||
do
|
||||
# clean up generated code from last run
|
||||
rm -rf tests/elm-stuff/generated-code/
|
||||
rm -rf build/tests/elm-stuff/generated-code/
|
||||
|
||||
exercise_dir=$(dirname $example_file)
|
||||
exercise_name=$(basename $example_file .example.elm)
|
||||
mv "$exercise_dir/$exercise_name.elm" "$exercise_dir/$exercise_name.impl"
|
||||
mv "$exercise_dir/$exercise_name.example.elm" "$exercise_dir/$exercise_name.elm"
|
||||
cp "$exercise_dir/$exercise_name.example.elm" "build/$exercise_name.elm"
|
||||
cp "$exercise_dir/tests/elm-package.json" build/tests/
|
||||
cp "$exercise_dir/tests/Tests.elm" build/tests/
|
||||
|
||||
echo '-------------------------------------------------------'
|
||||
echo "Testing $exercise_name"
|
||||
|
||||
cp "$exercise_dir/tests/Tests.elm" tests/
|
||||
|
||||
npm test -- tests/Tests.elm
|
||||
npm test -- build/tests/Tests.elm
|
||||
|
||||
# capture result from last command (elm-test)
|
||||
if [ $? -ne 0 ]; then
|
||||
TEST_RESULT=1
|
||||
FAILED_EXERCISES+="$exercise_name\n"
|
||||
fi
|
||||
|
||||
# be kind, rewind
|
||||
mv "$exercise_dir/$exercise_name.elm" "$exercise_dir/$exercise_name.example.elm"
|
||||
mv "$exercise_dir/$exercise_name.impl" "$exercise_dir/$exercise_name.elm"
|
||||
rm tests/Tests.elm
|
||||
done
|
||||
|
||||
if [ $TEST_RESULT -ne 0 ]; then
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
{
|
||||
"version": "3.0.0",
|
||||
"summary": "Exercism problems in Elm.",
|
||||
"repository": "https://github.com/exercism/xelm.git",
|
||||
"license": "BSD3",
|
||||
"source-directories": [
|
||||
".",
|
||||
"./exercises/hello-world",
|
||||
"./exercises/leap",
|
||||
"./exercises/pangram",
|
||||
"./exercises/rna-transcription",
|
||||
"./exercises/hamming",
|
||||
"./exercises/word-count",
|
||||
"./exercises/bob",
|
||||
"./exercises/run-length-encoding",
|
||||
"./exercises/difference-of-squares",
|
||||
"./exercises/anagram",
|
||||
"./exercises/raindrops",
|
||||
"./exercises/triangle",
|
||||
"./exercises/scrabble-score",
|
||||
"./exercises/accumulate",
|
||||
"./exercises/sublist",
|
||||
"./exercises/sum-of-multiples",
|
||||
"./exercises/strain",
|
||||
"./exercises/space-age",
|
||||
"./exercises/nucleotide-count",
|
||||
"./exercises/series",
|
||||
"./exercises/phone-number",
|
||||
"./exercises/grade-school",
|
||||
"./exercises/allergies",
|
||||
"./exercises/robot-simulator",
|
||||
"./exercises/list-ops",
|
||||
"./exercises/atbash-cipher",
|
||||
"./exercises/say",
|
||||
"./exercises/largest-series-product",
|
||||
"./exercises/roman-numerals",
|
||||
"./exercises/gigasecond"
|
||||
],
|
||||
"exposed-modules": [],
|
||||
"dependencies": {
|
||||
"elm-lang/core": "5.0.0 <= v < 6.0.0"
|
||||
},
|
||||
"elm-version": "0.18.0 <= v < 0.19.0"
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
{
|
||||
"version": "3.0.0",
|
||||
"summary": "Exercism problems in Elm.",
|
||||
"repository": "https://github.com/exercism/xelm.git",
|
||||
"license": "BSD3",
|
||||
"source-directories": [
|
||||
".",
|
||||
"../exercises/hello-world",
|
||||
"../exercises/leap",
|
||||
"../exercises/pangram",
|
||||
"../exercises/rna-transcription",
|
||||
"../exercises/hamming",
|
||||
"../exercises/word-count",
|
||||
"../exercises/bob",
|
||||
"../exercises/run-length-encoding",
|
||||
"../exercises/difference-of-squares",
|
||||
"../exercises/anagram",
|
||||
"../exercises/raindrops",
|
||||
"../exercises/triangle",
|
||||
"../exercises/scrabble-score",
|
||||
"../exercises/accumulate",
|
||||
"../exercises/sublist",
|
||||
"../exercises/sum-of-multiples",
|
||||
"../exercises/strain",
|
||||
"../exercises/space-age",
|
||||
"../exercises/nucleotide-count",
|
||||
"../exercises/series",
|
||||
"../exercises/phone-number",
|
||||
"../exercises/grade-school",
|
||||
"../exercises/allergies",
|
||||
"../exercises/robot-simulator",
|
||||
"../exercises/list-ops",
|
||||
"../exercises/atbash-cipher",
|
||||
"../exercises/say",
|
||||
"../exercises/largest-series-product",
|
||||
"../exercises/roman-numerals",
|
||||
"../exercises/gigasecond"
|
||||
],
|
||||
"exposed-modules": [],
|
||||
"dependencies": {
|
||||
"elm-lang/core": "5.0.0 <= v < 6.0.0",
|
||||
"elm-community/elm-test": "4.0.0 <= v < 5.0.0"
|
||||
},
|
||||
"elm-version": "0.18.0 <= v < 0.19.0"
|
||||
}
|
Loading…
Reference in a new issue