Repo to maintain and pre-build devcontainer images. The images can be used locally or on Github via Codespaces.
Best starting point to adapt the repository to your needs is by understanding the Workflow files.
- act.yml
- act/event-**
Event json files for local testing with act - act/act-test.sh
Test script to help during the development of Workflows/Jobs
- act/event-**
- debug.yml
Prints debug information of the event that triggered the Workflow run. Also dumbs the the github.event object as a json. This outputs can be used to debug Workflows locally by adding this outputs as event files. - docs.yml
Markdown linting - makefile-ci.yml
- publish.yml
Publishes the devcontainer images to the Github Container Registry - smoke-*** Smoke tests for the devcontainer images
Used to run Github Actions locally. github.com/nectos/act
The event files are used to simulate a Github event.
The event files are located in the .github/workflows/act
folder.
Example usage:
act create \
--workflows .github/workflows/publish.yml \
--eventpath .github/workflows/act/event-create-tag.json \
--dryrun
⚠️ TODOYou have to run the act commands in the vscode terminal. When a shell is opened via SSH the act commands will fail.
This is due to the fact that the environment variables are not set. Shell integration
This enables SSH access to a Github Actions runner. https://dev.to/github/debug-your-github-actions-via-ssh-by-using-tmate-1hd6
Used as the base image for all other devcontainers.
Build on top of base-ubuntu. Only used as a base for nrf-ci and nrf-devcontainer builds Only tools to build nrf connect SDK examples based on Zephyr are installed.
Based on this repo from Nordic
Requirements are that you have the Github CLI installed and the client is authenticated. If you are using SSH Keys to perform git actions, check the SSH Agent sections.
(Documentation)https://code.visualstudio.com/remote/advancedcontainers/sharing-git-credentials
This is only required if you want to use SSH to authenticate with Github. If you are using HTTPS, then you can skip this section.
When creating the devcontainer, and you want to use the ssh agent forwarding,
for Github, you need to add the following to your ~/.ssh/config
file:
# Github
Host github.com
HostName github.com
PreferredAuthentications publickey
User git
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
ForwardAgent yes
In your ~/.bashrc
file add the following:
# SSH Agent
# https://code.visualstudio.com/remote/advancedcontainers/sharing-git-credentials
if [ -z "$SSH_AUTH_SOCK" ]; then
# Check for a currently running instance of the agent
RUNNING_AGENT="`ps -ax | grep 'ssh-agent -s' | grep -v grep | wc -l | tr -d '[:space:]'`"
if [ "$RUNNING_AGENT" = "0" ]; then
# Launch a new instance of the agent
ssh-agent -s &> $HOME/.ssh/ssh-agent
fi
eval `cat $HOME/.ssh/ssh-agent`
fi