GitHub Actions
You're going to finish the GitHub Action demo from Friday in GitHub's web interface
Set Up
- Log into GitHub
- Navigate to the repository you forked on Friday
(called
java-example
)
GitHub Actions
- Click the Actions tab, click
set up a workflow yourself
. - Copy the contents of this file into the new
workflow file (
main.yml
). - Click
Start commit
. - Add a commit message.
- After you commit the file, I think the workflow starts right away. In a few minutes, the workflow fail.
- After the workflow fails (I had to click on the related commit
message to see that it failed -- the web interface wasn't showing
that it failed), click on
build
and view the logs.- If it doesn't jump you to the test failure, expand
the
Test
step. (Hopefully, you see the different steps that were taken to do the build.) - You should see the logs from Maven. There is a lot of output. Search for tests on the page so that you can see the error that failed.
- If it doesn't jump you to the test failure, expand
the
- Now that you know what test failed, right-click on
the
Code
tab and open it in a new tab. - Navigate to the test class (
AppTest.java
) so that you can look at which line in the test failed. - Navigate to the source code (
App.java
) - Edit the code (there is a pencil icon) so that it
uses
long
s instead ofint
s, as appropriate, as discussed in class. - Commit the code (describe the change you made).
- Go back to the Actions tab. You may see that
the Workflow has already run. It is named by the commit message.
If it didn't run, hang tight until it does.
Hopefully, it passed! If not, go back and fix the code.
- View
build
's logs. Again, search for tests, so that you can see the tests passed. - Click the Actions tab again.
Finishing up: What to turn in for this assignment
Take a screenshot of the "All Workflows" panel--showing the run that worked and the prior one that failed. For example: