Skip to content

Instantly share code, notes, and snippets.

@cds-amal
Last active March 30, 2023 12:52
Show Gist options
  • Save cds-amal/fb54f0dd5b24bd4323e591c81fc18a89 to your computer and use it in GitHub Desktop.
Save cds-amal/fb54f0dd5b24bd4323e591c81fc18a89 to your computer and use it in GitHub Desktop.

I set up a Github action to:

  1. Run tests when Consensys-Academy updates or creates a Pull Request against master
  2. Set up tests to be run by students when they fork the exercise repo
    • N.B. Students will have to enable GitHub actions when they fork. I view this as a good thing as it's never too early to start being aware of these concerns.

Some neat mechanics in this GH action

  • checks out a version of the tests from commit history so Student cannot cheat. N.b. this currently uses a tag and will have to change to match the actual github commit when finalized.
  • uses GH action context to load the appropriate tests discriminating on repo owner. That is, if the owner is Consensys-Academy one easy integration test runs to indicate tests are setup, or a version of the tests that checks all contract behavior.

Check out these two Actions report:

  1. CA's repo Notice that check mark! * Examine the CI details. Note the step for Setup for Consensys Academy
  2. My forked repo Notice that check mark! * CI details Notice how it has a step for Setup student grading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment