Skip to content

Adding test tags

Adding test tags #2

Workflow file for this run

name: Gradebot
# need a job called "Autograding" that is not nested within another action
# or reusable workflow, must be in separate job than autograding action to
# override the annotation
on:
push:
branches: [main]
workflow_dispatch:
permissions:
checks: write
actions: read
contents: write
jobs:
test:
name: Testing
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
checks: read
actions: read
contents: read
outputs:
homework_name: ${{ steps.homework_setup.outputs.homework_name }}
points: ${{ steps.autograder.outputs.points }}
autograder: ${{ steps.autograder.outcome }}
compile_status: ${{ steps.check_compile.outcome }}
javadoc_status: ${{ steps.check_javadoc.outcome }}
commits_status: ${{ steps.check_commits.outcome }}
min_commits: ${{ steps.check_commits.outputs.min_commits }}
num_commits: ${{ steps.check_commits.outputs.num_commits }}
steps:
- name: Setup homework environment
id: homework_setup
uses: usf-cs272-fall2023/cs272-bot/homework/setup@main
- name: Run tests and autograder
id: autograder
uses: education/autograding@v1
# run the following even if the autograder failed (but not if it was skipped or cancelled)
# check for compile and javadoc warnings
# must be after autograder to avoid compile issues
- name: Check for compile warnings
id: check_compile
uses: usf-cs272-fall2023/cs272-bot/homework/check-warnings@main
if: ${{ !cancelled() && (steps.autograder.outcome == 'success' || steps.autograder.outcome == 'failure') }}
with:
compile: true
javadoc: false
- name: Check for Javadoc warnings
id: check_javadoc
uses: usf-cs272-fall2023/cs272-bot/homework/check-warnings@main
if: ${{ !cancelled() && (steps.autograder.outcome == 'success' || steps.autograder.outcome == 'failure') }}
with:
compile: false
javadoc: true
# check commits while we still have the repository checked out
- name: Check for minimum number of commits
id: check_commits
uses: usf-cs272-fall2023/cs272-bot/homework/check-commits@main
if: ${{ !cancelled() && (steps.autograder.outcome == 'success' || steps.autograder.outcome == 'failure') }}
grade:
name: Autograding
needs: test
runs-on: ubuntu-latest
if: ${{ !cancelled() && (needs.test.outputs.autograder == 'success' || needs.test.outputs.autograder == 'failure') }}
steps:
# calculate late penalty
- name: Check deadline and calculate late penalties
id: check_deadline
uses: usf-cs272-fall2023/cs272-bot/actions/check-deadline@main
with:
assignment_name: ${{ needs.test.outputs.homework_name }}
starting_points: ${{ needs.test.outputs.points }}
# calculate grade and output annotations
- name: Calculate final grade after deductions
id: grade_homework
uses: usf-cs272-fall2023/cs272-bot/homework/grade@main
with:
grade_results: ${{ toJSON(steps.check_deadline.outputs) }}
compile_status: ${{ needs.test.outputs.compile_status }}
javadoc_status: ${{ needs.test.outputs.javadoc_status }}
commits_status: ${{ needs.test.outputs.commits_status }}
num_commits: ${{ needs.test.outputs.num_commits }}
min_commits: ${{ needs.test.outputs.min_commits }}
# create badge for readme file
- name: Create Badge
uses: usf-cs272-fall2023/cs272-bot/homework/badge@main
with:
outcome: ${{ needs.test.outputs.autograder }}
points: ${{ steps.grade_homework.outputs.final_points }}