This guide will walk you through the process of setting up your homework repository and importing it into Eclipse.
One-Time Setup
Before you begin, you need to make sure to go through the other setup guides first:
This includes making sure you have a GitHub account linked to your USF email. See the Getting Started with GitHub guide for details.
Per-Homework Setup
For every homework assignment, you will need to repeat these steps:
-
Setup your GitHub repository.
-
Find the homework assignment on Canvas. For example, go to the ArgumentParser assignment on Canvas for the first homework of the semester.
-
Click the Github Classroom invitation link and follow the instructions.
-
If this is your first time using Github Classroom, you will be prompted to select your USF username from the list. This makes sure we can associate your Github username with your grades in Canvas. You only need to complete this step once.
This process will create a private Github repository with the homework starter code that only you, the teacher assistants, and the instructor can access.
-
-
Setup your Eclipse project.
Once your repository is setup, you must import the homework as a Java Maven Project in Eclipse. See the Importing Eclipse Projects from Github guide for detailed steps.
When done, the “Package Explorer” view of your homework should look something like this:
Make sure the correct Java version is showing up and that you are in the “Java” perspective before moving on. This perspective allows you to run Java code. The “Git” perspective lets you view, but not run, Java code.
-
Verify you can run the JUnit tests on Eclipse locally.
The tests will be in the
src
»test
»java
subfolder. Right-click the test file and select “Run As” » “JUnit Test” from the menu.That should open up the “JUnit” view automatically, which will look similar to this:
These are the tests you will need to pass for the homework. Most of the tests will fail the first time.
-
Commit and push changes to Github.
In Eclipse, make a minor change and commit and push that change to Github.
I recommend placing the Git Staging View somewhere on your Eclipse layout to make this process more convenient. You can access that view via the “Window” » “Show View” » “Other…” option in the menu. Open the “Git” folder to find the “Git Staging View” option to add it to your layout:
Make sure to drag files from the “Unstaged” to the “Staged” box and add a commit message. Sometimes, you need to click the “Refresh” button in the upper right corner of the view to update. For example:
Click “Commit and Push” to make a checkpoint and push that checkpoint to Github. If you click “Commit” you only make a local checkpoint on your system.
-
Verify the Autograder Github Action ran properly.
Visit your repository on Github. Click the “Actions” tab to view all of the runs. There should be a run with the same name as your last commit.
Make sure the action finishes running. Here is an example of what a completed action looks like:
https://github.com/usf-cs272-spring2022/homework-ArgumentParser-template/actions/runs/1763252998Scroll down in the “Summary” view to see the “Annotations” section. That will report the number of points your homework has earned so far:
For details on which tests failed, you need to drill into the “Autograding” output.
You can also see the number of points on the README.md file as well:
You may need to refresh your view on Github to see the latest result.
At this point, you should be able to start completing and testing the homework.