github-education-resources / autograding

GitHub Education Auto-grading and Feedback for GitHub Classroom
MIT License
59 stars 68 forks source link

How do I set the Java version? #18

Open khatchad opened 4 years ago

khatchad commented 4 years ago

Seems like the autograder is using a Java version less than 11. How do I specify a newer Java version?

jeffrafter commented 4 years ago

Sorry for the slow reply! Yes we are using the default GitHub Actions Java version (https://help.github.com/en/actions/reference/software-installed-on-github-hosted-runners). We've been discussing ways to do this from within GitHub Classroom in the future but it is not possible right now.

To workaround this:

  1. Create an assignment with autograding setup as you would want
  2. Accept the assignment... grab the .github/workflows/classroom.yml and .github/classroom/autograding.json files
  3. Change the workflow to include the setup-java action (https://github.com/actions/setup-java)
  4. Add the files to your template repository
  5. Recreate the assignment and do not setup autograding

This is definitely super-cumbersome... but should allow you to change the workflow as you see fit.

john-french commented 3 years ago

~I had a similar problem @khatchad, I tried something like the above but found this (hacky) solution worked for me.~

Scrap that. The solution @jeffrafter posted above does actually work for setting up autograding with a specific java version, and it's less cumbersome than my initial hack.

oxzi commented 3 years ago

Is there anything new in the meantime? I need a newer Python than version 3.6 and I find the manual customization of all student repositories tedious. The repositories can be created at any time within a week. Every week.

john-french commented 3 years ago

@oxzi I use a template repository with a .github folder in it, containing the classroom.yml file I need (using the setup-java action), and a template autograding.json. Any assignment repositories I create use this repo as a template. I don't need to manually customise any student repos after this, all student repos get the correct setup. You could use the setup-python action in your classroom.yml. I can share my template repo with you if you like (it's also got a Java .gitignore in it that you could.... ignore :slightly_smiling_face:).

oxzi commented 3 years ago

@john-french: Thanks! I assumed that an existing classroom.yml would be overwritten and already started building an Action to alter an existing classroom.yml file afterwards. I will try this for next week's exercise.

john-french commented 3 years ago

It seems not @oxzi, as long as you don't add autograding in the assignment creation GUI in github classroom

oxzi commented 3 years ago

@john-french: I just wanted to say thank you again. For the upcoming weekly exercise I created the two files manually in my template repository, as recommended. This way they were delivered to the students and also executed.

Of course it would be even nicer if this did not have to be done by hand. If anyone at GitHub is reading this...

jeffrafter commented 3 years ago

@oxzi just wanted to note that changes to allow this were brought up within the past few weeks and I am still advocating for it. Thanks for persisting and working around the shortcomings!