-
Notifications
You must be signed in to change notification settings - Fork 0
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
Krasimir
committed
Nov 25, 2024
1 parent
83bc2a4
commit 0734af5
Showing
1 changed file
with
92 additions
and
25 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 |
---|---|---|
@@ -1,25 +1,92 @@ | ||
- name: Debug No Args Test | ||
run: | | ||
echo "Running: ./assignment" | ||
./assignment | ||
echo "Exit Code: $?" | ||
- name: Debug One Arg Test | ||
run: | | ||
echo "Running: ./assignment 1" | ||
./assignment 1 | ||
echo "Exit Code: $?" | ||
- name: Debug Three Args Test | ||
run: | | ||
echo "Running: ./assignment 1 2 3" | ||
./assignment 1 2 3 | ||
echo "Exit Code: $?" | ||
- name: Debug Valid Args Test | ||
run: | | ||
echo "Running: ./assignment 5 10" | ||
./assignment 5 10 | ||
echo "Exit Code: $?" | ||
echo "Contents of matrix.txt:" | ||
cat matrix.txt || echo "matrix.txt not found" | ||
name: Autograding Tests | ||
'on': | ||
- push | ||
- repository_dispatch | ||
permissions: | ||
checks: write | ||
actions: read | ||
contents: read | ||
jobs: | ||
run-autograding-tests: | ||
runs-on: ubuntu-latest | ||
if: github.actor != 'github-classroom[bot]' | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Matrix output test | ||
id: matrix-output-test | ||
uses: classroom-resources/autograding-command-grader@v1 | ||
with: | ||
test-name: Matrix output test | ||
setup-command: '' | ||
command: make test | ||
timeout: 10 | ||
max-score: 2 | ||
|
||
- name: Debug Matrix Output Test | ||
run: | | ||
echo "Running: make test" | ||
make test | ||
echo "Exit Code: $?" | ||
- name: No args test | ||
id: no-args-test | ||
uses: classroom-resources/autograding-command-grader@v1 | ||
with: | ||
test-name: No args test | ||
setup-command: chmod +x checkargs.sh | ||
command: ./checkargs.sh "./assignment" "Incorrect usage. You provided 0 arguments. The correct number of arguments is 2" | ||
timeout: 10 | ||
max-score: 1 | ||
|
||
- name: Debug No Args Test | ||
run: | | ||
echo "Running ./assignment with no arguments" | ||
./assignment || echo "Exit Code: $?" | ||
- name: One arg test | ||
id: one-arg-test | ||
uses: classroom-resources/autograding-command-grader@v1 | ||
with: | ||
test-name: One arg test | ||
setup-command: chmod +x checkargs.sh | ||
command: ./checkargs.sh "./assignment 1" "Incorrect usage. You provided 1 arguments. The correct number of arguments is 2" | ||
timeout: 10 | ||
max-score: 1 | ||
|
||
- name: Debug One Arg Test | ||
run: | | ||
echo "Running ./assignment with one argument" | ||
./assignment 1 || echo "Exit Code: $?" | ||
- name: Three args test | ||
id: three-args-test | ||
uses: classroom-resources/autograding-command-grader@v1 | ||
with: | ||
test-name: Three args test | ||
setup-command: chmod +x checkargs.sh | ||
command: ./checkargs.sh "./assignment 1 2 3" "Incorrect usage. You provided 3 arguments. The correct number of arguments is 2" | ||
timeout: 10 | ||
|
||
- name: Debug Three Args Test | ||
run: | | ||
echo "Running ./assignment with three arguments" | ||
./assignment 1 2 3 || echo "Exit Code: $?" | ||
- name: Debug Valid Args Test | ||
run: | | ||
echo "Running ./assignment with valid arguments" | ||
./assignment 5 10 || echo "Exit Code: $?" | ||
echo "Contents of matrix.txt:" | ||
cat matrix.txt || echo "matrix.txt not found" | ||
- name: Autograding Reporter | ||
uses: classroom-resources/autograding-grading-reporter@v1 | ||
env: | ||
MATRIX-OUTPUT-TEST_RESULTS: "${{steps.matrix-output-test.outputs.result}}" | ||
NO-ARGS-TEST_RESULTS: "${{steps.no-args-test.outputs.result}}" | ||
ONE-ARG-TEST_RESULTS: "${{steps.one-arg-test.outputs.result}}" | ||
THREE-ARGS-TEST_RESULTS: "${{steps.three-args-test.outputs.result}}" | ||
with: | ||
runners: matrix-output-test,no-args-test,one-arg-test,three-args-test |