A template repository for Java programming labs using GitHub Classroom with automated test grading via GitHub Actions.
This project serves as a proof-of-concept template for first-year Java programming labs, leveraging GitHub Codespaces for a browser-based development environment and GitHub Classroom for automated submission management. Students complete Java exercises involving Scanner input/output, and their code is automatically compiled and tested using JUnit 5 with the system-lambda library for console I/O verification.
- Four structured Java exercises focusing on
Scannerinput and console output - Automated grading via GitHub Actions and GitHub Classroom autograding
- JUnit 5 test suite with system-lambda for stdin/stdout testing
- VS Code Dev Container for a consistent Java development environment
- Shell-based test runner for compiling and executing individual exercise tests
- Each exercise worth 25 points (100 total)
- Java 8 or higher (Java 8 is used in the CI workflow)
- Git for version control
- A GitHub account with access to GitHub Classroom
-
Use this template to create a new GitHub Classroom assignment, or clone it directly:
git clone https://github.com/danielcregg/github-classroom-lab-template.git cd github-classroom-lab-template -
Open in GitHub Codespaces or a local Dev Container for a pre-configured Java environment.
Complete each exercise by writing your Java code in the corresponding file (Exercise1.java through Exercise4.java) where indicated by the // YOUR CODE HERE comment.
Run a test for a specific exercise locally:
./bin/run_test.sh Exercise1Submit your work:
git add .
git commit -m "Complete exercises"
git push origin mainPushing to main triggers the GitHub Classroom autograding workflow, which compiles and runs the JUnit tests for all four exercises.
- Java - Programming language for exercises and tests
- JUnit 5 - Testing framework
- system-lambda - Library for testing console I/O in JUnit 5
- Hamcrest - Matcher library for expressive test assertions
- GitHub Actions - CI/CD for automated grading
- GitHub Codespaces - Browser-based development environment
This project is licensed under the MIT License. See the LICENSE file for details.