Codespaces: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
m (→Steps Overview:  added free hours info)  | 
				m (small changes)  | 
				||
| Line 16: | Line 16: | ||
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].  | Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].  | ||
== Example 1: KallistiOS   | == Example 1: Build an .elf from a KallistiOS example ==  | ||
To compile the KallistiOS examples in a Codespace:  | To compile the executable .elf file from a KallistiOS examples in a Codespace:  | ||
* Login into [https://github.com github]  | * Login into [https://github.com github]  | ||
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]  | * Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]  | ||
Revision as of 18:28, 13 July 2024
Github Codespaces lets you spawn a Dreamcast development environment in your browser in a matter of minutes.
The only things you need are:
- a browser
 - a github login.
 
Steps Overview
The main steps to get a Codespace working, are:
- Login into github
 - Create your code repository, or fork one
 - Add a .devcontainer/devcontainer.json file to that repository
 - Create & launch your codespace, and enjoy the IDE in your browser !
 
That's all there is to it.
Free github accounts get 120 free core hours per month.
Example 1: Build an .elf from a KallistiOS example
To compile the executable .elf file from a KallistiOS examples in a Codespace:
- Login into github
 - Got to the KallistiOS repository
 - Click on the "Fork" button, this will create a KallistiOS repository inside your account
 - Click on the "Add File" button, then "Create New File"
 - Name the file: ".devcontainer/devcontainer.json", and paste the following contents:
 
// For format details, see https://aka.ms/devcontainer.json. 
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine
{
	"name": "My_Codespace",
		
	// Either use a pre-built image (= a Docker container)...
	"image": "ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0",
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
	//"build": { // Path is relative to the devcontainer.json file.
	//    "dockerfile": "Dockerfile"
	//},
		
	// Features to add to the dev container. More info: https://containers.dev/features.
	// "features": {},
	// Use 'forwardPorts' to make a list of ports inside the container available locally.
	// "forwardPorts": [],
	// Use 'postCreateCommand' to run commands after the container is created.
	//"postCreateCommand": "source /opt/toolchains/dc/kos/environ.sh",
	// Configure tool-specific properties.
	"customizations": {
	    "vscode": {
	        "extensions": [
		    "ms-vscode.cpptools"
	        ]
	    }
	}
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
	// "remoteUser": "root"
}
- Commit (aka, save) the file
 - Launch your Codespace by clicking on the "<> Code" button, then "Codespaces" - "Create codespace on main".
 - This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.
 - TODO: navigate to examples, compile one, download elf
 
Example 2: TODO
Tips
- TODO