Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dev container, GitHub Codespaces support #3

Merged
merged 11 commits into from
Oct 10, 2023
45 changes: 45 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
{
"name": "Rust",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/rust:1-1-bullseye",
marcinkurek marked this conversation as resolved.
Show resolved Hide resolved

// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
// "mounts": [
// {
// "source": "devcontainer-cargo-cache-${devcontainerId}",
// "target": "/usr/local/cargo",
// "type": "volume"
// }>>
// ]

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {}
},

// 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": "bash .devcontainer/post-create.sh",

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
// "settings": {},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"TechTheAwesome.rust-yew"
]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
5 changes: 5 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

rustup target add wasm32-unknown-unknown
cargo install trunk
pre-commit install
101 changes: 101 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
marcinkurek marked this conversation as resolved.
Show resolved Hide resolved
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'chombo-gen-common'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=chombo-gen-common"
],
"filter": {
"name": "chombo-gen-common",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'chombo-gen-backend'",
"cargo": {
"args": [
"build",
"--bin=chombo-gen-backend",
"--package=chombo-gen-backend"
],
"filter": {
"name": "chombo-gen-backend",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'chombo-gen-backend'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=chombo-gen-backend",
"--package=chombo-gen-backend"
],
"filter": {
"name": "chombo-gen-backend",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'chombo-gen-frontend'",
marcinkurek marked this conversation as resolved.
Show resolved Hide resolved
"cargo": {
"args": [
"build",
"--bin=chombo-gen-frontend",
"--package=chombo-gen-frontend"
],
"filter": {
"name": "chombo-gen-frontend",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'chombo-gen-frontend'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=chombo-gen-frontend",
"--package=chombo-gen-frontend"
],
"filter": {
"name": "chombo-gen-frontend",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}