-
-
Notifications
You must be signed in to change notification settings - Fork 9
GitHub Actions Testing Files and Bug Fixes #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c3ba6c4
Add support files to test.yml workflow
eNascimento178 1d14767
Implement test workflows
eNascimento178 1785ee8
test
eNascimento178 7d5b3ee
Revert "test"
eNascimento178 1e5833c
Correct error in pascals-triangle
eNascimento178 7d22ccd
Correct scripts
eNascimento178 e86d9a8
Correct all-your-base tests
eNascimento178 eb2460d
Reformat anagram
eNascimento178 5448c49
Reformat collatz
eNascimento178 8b20786
Reformat difference-of-squares
eNascimento178 a2f77f4
Reformat dnd-character
eNascimento178 5b9c8bc
Reformat hamming
eNascimento178 c0a7fbe
Reformat leap
eNascimento178 f7f5133
Correct and reformat raindrops
eNascimento178 df0d6fb
Correct and reformat sum of multiples
eNascimento178 e3fd790
Set executable bit
ErikSchierboom 852ed82
Update .github/workflows/test.yml
eNascimento178 ec0278b
Update .github/workflows/test.yml
eNascimento178 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,45 @@ | ||
# 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/test | ||
|
||
name: J / Test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
eNascimento178 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | ||
|
||
- name: Install project dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends wget ca-certificates | ||
|
||
- name: Install J | ||
run: | | ||
wget https://www.jsoftware.com/download/j9.5/install/j9.5_linux64.tar.gz | ||
tar -xvf j9.5_linux64.tar.gz | ||
mv j9.5 /opt/j9.5 | ||
rm -rf j9.5_linux64.tar.gz | ||
|
||
- name: Verify all exercises | ||
run: bin/verify-exercises.sh |
Empty file.
This file contains hidden or 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 @@ | ||
#! /opt/j9.5/bin/jconsole | ||
|
||
try_error=: 3 : 0 | ||
for_i. y do. | ||
test_name =. > i | ||
error_expected =. ( 5 }. test_name , '_expect')~ | ||
try. | ||
0!:100 fputs test_name , (quote'') | ||
catch. | ||
errname=. > (<: 13!:11'') { 9!:8'' | ||
if. errname -.@-: error_expected do. | ||
0 return. | ||
end. | ||
end. | ||
end. | ||
1 return. | ||
) | ||
|
||
main=: monad define | ||
exercise_dir=. _1 { ARGV | ||
1!:44 >exercise_dir | ||
tests=. ('[a-zA-Z0-9[-]*]*[.]ijs'; '.meta/example.ijs') rxrplc 1!:1 <'test.ijs' NB. Replace load directive for the tests | ||
0!:0 tests NB. load to put the tests in `nl` | ||
before_all '' NB. tests verbs depends on values setted at `before_all` | ||
tests=. 'test_' nl 3 NB. get defined tests from `nl` | ||
errors=. ('test_'&,)each (_7&}.)each '_expect*' nl 0 | ||
|
||
if. 0-.@-:#errors do. | ||
'expect_value expect_error'=. (tests e. errors) </. tests | ||
test_values=. 0!:3 fputs (,&(quote''))every expect_value | ||
test_errors=. try_error expect_error | ||
exit -.(test_values *. test_errors) | ||
else. | ||
exit -. 0!:3 fputs (,&(quote''))every tests | ||
end. | ||
|
||
) | ||
|
||
main'' |
This file contains hidden or 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,43 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Synopsis: | ||
# Test the track's exercises. | ||
# | ||
# At a minimum, this file must check if the example/exemplar solution of each | ||
# Practice/Concept Exercise passes the exercise's tests. | ||
# | ||
# To check this, you usually have to (temporarily) replace the exercise's solution files | ||
# with its exemplar/example files. | ||
# | ||
# If your track uses skipped tests, make sure to (temporarily) enable these tests | ||
# before running the tests. | ||
# | ||
# The path to the solution/example/exemplar files can be found in the exercise's | ||
# .meta/config.json file, or possibly inferred from the exercise's directory name. | ||
|
||
# Example: | ||
# ./bin/test | ||
|
||
exit_code=0 | ||
|
||
# Verify the Concept Exercises | ||
# for concept_exercise_dir in ./exercises/concept/*/; do | ||
# if [ -d $concept_exercise_dir ]; then | ||
# echo "Checking $(basename "${concept_exercise_dir}") exercise..." | ||
# # TODO: run command to verify that the exemplar solution passes the tests | ||
# 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..." | ||
res=$(/opt/j9.5/bin/jconsole bin/test_exercise.ijs "$practice_exercise_dir/") | ||
if [ $? -ne 0 ]; then | ||
echo "Error in ${practice_exercise_dir}" | ||
((exit_code++)) | ||
fi | ||
fi | ||
done | ||
|
||
exit $exit_code |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.