Skip to content

Commit

Permalink
chore(devcontainer): Fixed errors and added CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lmilbaum committed Apr 15, 2023
1 parent d8400d3 commit 21eaba8
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 14 deletions.
10 changes: 10 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,15 @@ FROM ghcr.io/containerbase/node:18.16.0@sha256:fc48ac97eb5d0dee207d4a336a52d7d3b

USER root

WORKDIR /workspace
COPY . .

RUN apt update; \
apt install -y 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
RUN yarn install
30 changes: 18 additions & 12 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
{
"hostRequirements": {
"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"
"context": "..",
"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",
"seccomp=unconfined",
"--privileged"
],
"postCreateCommand": "yarn install"
]
}
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:
build:
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
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@
"optionalDependencies": {
"re2": "1.18.0"
},
"DependenciesMeta": {
"re2": {
"built": false
}
},
"devDependencies": {
"@jest/globals": "29.5.0",
"@jest/reporters": "29.5.0",
Expand Down

0 comments on commit 21eaba8

Please sign in to comment.