Skip to content

Commit

Permalink
add github actions test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelborkowski committed Oct 27, 2023
1 parent 57d7467 commit 842c833
Show file tree
Hide file tree
Showing 6 changed files with 242 additions and 3 deletions.
Empty file added .github/.keep
Empty file.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/* @ucsd-cse230/ta
214 changes: 214 additions & 0 deletions .github/classroom/autograding.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{
"tests": [
{
"name": "rev-1",
"run": "stack test --test-arguments '-p rev-1'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 5
},
{
"name": "foldr-1",
"run": "stack test --test-arguments '-p foldr-1'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 5
},
{
"name": "foldl-1",
"run": "stack test --test-arguments '-p foldl-1'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 5
},
{
"name": "eval-1",
"run": "stack test --test-arguments '-p eval-1'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 2
},
{
"name": "eval-2",
"run": "stack test --test-arguments '-p eval-2'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 2
},
{
"name": "eval-3",
"run": "stack test --test-arguments '-p eval-3'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 2
},
{
"name": "eval-4",
"run": "stack test --test-arguments '-p eval-4'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 2
},
{
"name": "eval-5",
"run": "stack test --test-arguments '-p eval-5'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 2
},
{
"name": "eval-6",
"run": "stack test --test-arguments '-p eval-6'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 2
},
{
"name": "eval-7",
"run": "stack test --test-arguments '-p eval-7'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 2
},
{
"name": "eval-8",
"run": "stack test --test-arguments '-p eval-8'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 2
},
{
"name": "eval-9",
"run": "stack test --test-arguments '-p eval-9'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 2
},
{
"name": "eval-10",
"run": "stack test --test-arguments '-p eval-10'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 2
},
{
"name": "exec-1",
"run": "stack test --test-arguments '-p exec-1'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 5
},
{
"name": "exec-2",
"run": "stack test --test-arguments '-p exec-2'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 5
},
{
"name": "exec-3",
"run": "stack test --test-arguments '-p exec-3'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 5
},
{
"name": "exec-4",
"run": "stack test --test-arguments '-p exec-4'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 5
},
{
"name": "parse-1",
"run": "stack test --test-arguments '-p parse-1'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 5
},
{
"name": "parse-2",
"run": "stack test --test-arguments '-p parse-2'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 5
},
{
"name": "parse-3",
"run": "stack test --test-arguments '-p parse-3'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 5
},
{
"name": "parse-4",
"run": "stack test --test-arguments '-p parse-4'",
"setup": "",
"input": "",
"output": "",
"comparison": "included",
"timeout": 30,
"points": 5
}
]
}
11 changes: 11 additions & 0 deletions .github/workflows/classroom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: GitHub Classroom Workflow

on: [push]

jobs:
build:
name: Autograding
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: education/autograding@v1
13 changes: 13 additions & 0 deletions .github/workflows/create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Create branch protection rule"
on: create

jobs:
test: # Test action's functionality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: infamous-riddles/branch-guardian@v1
with:
PERSONAL-ACCESS-TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
BASE-BRANCH-PATTERN: '^main$'
REQUIRED-NUMBER-OF-REVIEWERS: 1
6 changes: 3 additions & 3 deletions test/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ probEval sc = testGroup "Problem 2: Eval"
probParse :: Score -> TestTree
probParse sc = testGroup "Problem 3: Parse"
[ scoreTestI ((\_ -> parseFile "test/in/fact.imp"), (), Right w_fact, 5, "parse-1")
, scoreTestI ((\_ -> parseFile "test/in/abs.imp"), (), Right w_abs, 5, "parse-1")
, scoreTestI ((\_ -> parseFile "test/in/times.imp"), (), Right w_times, 5, "parse-1")
, scoreTestI ((\_ -> parseFile "test/in/test.imp"), (), Right w_test, 5, "parse-1")
, scoreTestI ((\_ -> parseFile "test/in/abs.imp"), (), Right w_abs, 5, "parse-2")
, scoreTestI ((\_ -> parseFile "test/in/times.imp"), (), Right w_times, 5, "parse-3")
, scoreTestI ((\_ -> parseFile "test/in/test.imp"), (), Right w_test, 5, "parse-4")
]
where
scoreTestI :: (Show b, Eq b) => (a -> IO b, a, b, Int, String) -> TestTree
Expand Down

0 comments on commit 842c833

Please sign in to comment.