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

chore(devcontainer): Fixed errors and added CI workflow #21515

Merged
merged 11 commits into from
Apr 17, 2023
5 changes: 5 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ FROM ghcr.io/containerbase/node:18.16.0

USER root

RUN install-apt make g++

# renovate: datasource=github-releases packageName=containerbase/python-prebuild
RUN install-tool python 3.11.3

# renovate: datasource=npm
RUN install-tool yarn 1.22.19
27 changes: 17 additions & 10 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
{
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json",
"hostRequirements": {
lmilbaum marked this conversation as resolved.
Show resolved Hide resolved
"cpus": 4,
"memory": "8gb",
"memory": "7gb",
"storage": "32gb"
},
"name": "Renovate",
"dockerFile": "Dockerfile",
"settings": {
"terminal.integrated.profiles.linux": { "bash": { "path": "/bin/bash" } },
"terminal.integrated.defaultProfile.linux": "bash"
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.profiles.linux": {
"bash": { "path": "/bin/bash" }
},
"terminal.integrated.defaultProfile.linux": "bash"
},
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"orta.vscode-jest",
"EditorConfig.editorconfig"
]
}
},
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"orta.vscode-jest",
"EditorConfig.editorconfig"
],
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: devcontainer
on:
pull_request:
branches:
- main

jobs:
devcontainer-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.5.2

- name: Build and run dev container task
uses: devcontainers/ci@v0.3.1900000328
with:
runCmd: yarn build
10 changes: 8 additions & 2 deletions docs/development/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,22 @@ If you already installed a part, skip the corresponding step.
PS C:\Windows\system32> yarn --version
```

#### VS Code Remote Development
#### VS Code Dev Containers

If you are using [VS Code](https://code.visualstudio.com/) you can skip installing [the prerequisites](#prerequisites) and work in a [development container](https://code.visualstudio.com/docs/remote/containers) instead.
If you are using [VS Code](https://code.visualstudio.com/) you can skip installing [the prerequisites](#prerequisites) and work in a [development container](https://code.visualstudio.com/docs/devcontainers/containers) instead.

- Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) and [check its system requirements](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers#system-requirements)
- Open the repository folder in VS Code
- Choose "Reopen in Container" via the command palette or the small button in the lower left corner

The VS Code [integrated terminal](https://code.visualstudio.com/docs/editor/integrated-terminal) is now running in the container and can be used to run additional commands.

To build inside the container:

```shell
yarn build
```

#### Local Docker

If, for some reason, you can't run the relevant versions on your local machine, you can run everything from a Docker image.
Expand Down