-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
74 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# This workflow will do a clean install of the dependencies and run tests across different versions | ||
# | ||
# Replace <track> with the track name | ||
# Replace <image-name> with an image to run the jobs on | ||
# Replace <action to setup tooling> with a github action to setup tooling on the image | ||
# Replace <install dependencies> with a cli command to install the dependencies | ||
# | ||
# Find Github Actions to setup tooling here: | ||
# - https://github.com/actions/?q=setup&type=&language= | ||
# - https://github.com/actions/starter-workflows/tree/main/ci | ||
# - https://github.com/marketplace?type=actions&query=setup | ||
# | ||
# Requires scripts: | ||
# - bin/verify-exercises | ||
|
||
name: Verify Exercises | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: exercism/lfe-test-runner | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
|
||
- name: Verify all exercises | ||
run: bin/verify-exercises |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
temp_dir_base=$(mktemp -d) | ||
|
||
run_test() { | ||
slug=$(basename $1) | ||
temp_dir=${temp_dir_base}/${slug} | ||
mkdir -p ${temp_dir} | ||
|
||
cp -r "$1/." $temp_dir | ||
cp $temp_dir/.meta/example.lfe $temp_dir/src/$slug.lfe | ||
|
||
(cd /opt/test-runner && bin/run.sh $slug $temp_dir $temp_dir) || exit 1 | ||
|
||
test_status="$(jq -r '.status' $temp_dir/results.json)" | ||
|
||
if [ "$test_status" != "pass" ]; then | ||
echo "Tests for $slug have failed:" | ||
cat $temp_dir/results.json | ||
exit 1 | ||
fi | ||
} | ||
|
||
|
||
|
||
for concept_exercise_dir in ./exercises/concept/*/; do | ||
if [ -d $concept_exercise_dir ]; then | ||
echo "Checking $(basename "${concept_exercise_dir}") exercise..." | ||
run_test $concept_exercise_dir | ||
fi | ||
done | ||
|
||
# Verify the Practice Exercises | ||
for practice_exercise_dir in ./exercises/practice/*/; do | ||
if [ -d $practice_exercise_dir ]; then | ||
echo "Checking $(basename "${practice_exercise_dir}") exercise..." | ||
run_test $practice_exercise_dir | ||
fi | ||
done |