-
Notifications
You must be signed in to change notification settings - Fork 164
Setting up Github Actions
This page details the requirements for setting up your build host to run Github Actions. Github Actions may be run on your build host or another host setup as shown below.
For build host requirements, see this page.
Setup automated testing for your assignment repository following the instructions at https://docs.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners.
- You must use a Linux (x86_64) based runner for the assignments.
- You must also ensure your runner machine has docker installed. See install instructions here for Ubuntu.
- You must also configure Docker to run as a non-root user on your machine. See the Post install steps for Linux for instructions. Either reboot your machine, restart the command prompt associated with your runner, or run the
newgrpcommand referenced in the instructions to apply group permissions. - Alternatively you can run this script to perform the above step docker_install.sh
- You must also configure Docker to run as a non-root user on your machine. See the Post install steps for Linux for instructions. Either reboot your machine, restart the command prompt associated with your runner, or run the
- See instructions in the Setting up your host section of the assignment autotest repository to setup your host to run your tests outside self hosted runners.
- Your runner should installed to a directory outside your repository, and you should not add any files associated with your self hosted runner setup to your assignment git repository.
To re-use a previously configured runner from a previous assignment you can remove it first using https://docs.github.com/en/actions/hosting-your-own-runners/removing-self-hosted-runners.
Then re-follow the instructions at https://docs.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners to add to your next assignment repository.
Assignments which use buildroot or yocto (assignments 4 and later) require a github secret to access your assignment 3 and earlier repository. This configuration must be set on each repository containing buildroot or yocto source. In other words, you must set this secret in the repository you use with buildroot or yocto build scripts.
- Generate an SSH key with with empty passphrase using these instructions. Tip: use a name like “aeld_id_rsa_nopassphrase” when creating.
- Add to your account using instructions here
- Copy the entire content of the private key file (including
-----BEGIN RSA PRIVATE KEY-----and-----END RSA PRIVATE KEY-----) into a secret namedSSH_PRIVATE_KEYusing the instructions in this link
When successfully configured, you should see a green checkbox indicating a successful check for the assignment automated tests.

Browsing the "Actions" tab should show a successful result for the most recent commit

Clicking on the most recent action and viewing the job logs for unit-test and/or full-test scripts should show the same result you see when running these scripts from your host build system, with all tests passing.

To verify your private key works with your repository clone: First use
ssh-agent
to start the SSH agent in your terminal window.
- Then use
ssh-add <path to keyfile>to add the same key you added to your github secret. - Finally, attempt to clone your repository using the SSH URL found in your target github repository.
- If this works, your key should also work with github actions, provided you have included the full content of your private key file in the definition of the
SSH_PRIVATE_KEYvariable.