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 4e44417 commit edcd2d5
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 14 deletions.
9 changes: 9 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,14 @@ FROM ghcr.io/containerbase/node:18.16.0@sha256:fc48ac97eb5d0dee207d4a336a52d7d3b

USER root

COPY . .

RUN apt update; \
apt install -y make g++

# renovate: datasource=github-releases
RUN install-tool python 3.11.3

# renovate: datasource=npm
RUN install-tool yarn 1.22.19
RUN yarn install
29 changes: 17 additions & 12 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
{
"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"
"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 test
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
#### VSCode Remote Development

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 [VSCode](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.

- 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 run unit tests inside the container:

```shell
yarn test
```

#### 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

0 comments on commit edcd2d5

Please sign in to comment.