-
Notifications
You must be signed in to change notification settings - Fork 159
feat: add support for devcontainers #5366
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
Open
remyleone
wants to merge
4
commits into
scaleway:main
Choose a base branch
from
remyleone:dependabot_devcontainers
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+84
−0
Open
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ARG VARIANT="dev-1.26-bookworm" | ||
| FROM mcr.microsoft.com/vscode/devcontainers/go:${VARIANT} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
| // https://github.com/microsoft/vscode-dev-containers/tree/v0.231.6/containers/go | ||
| { | ||
| "name": "Go", | ||
| "build": { | ||
| "dockerfile": "Dockerfile", | ||
| "args": { | ||
| // Update the VARIANT arg to pick a version of Go: 1, 1.18, 1.17 | ||
| // Append -bullseye or -buster to pin to an OS version. | ||
| // Use -bullseye variants on local arm64/Apple Silicon. | ||
| "VARIANT": "dev-1.26-bookworm", | ||
| // Options | ||
| "NODE_VERSION": "none" | ||
| } | ||
| }, | ||
| "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], | ||
|
|
||
| // Set *default* container specific settings.json values on container create. | ||
| "settings": { | ||
| "go.toolsManagement.checkForUpdates": "local", | ||
| "go.useLanguageServer": true, | ||
| "go.gopath": "/go" | ||
| }, | ||
|
|
||
| // Add the IDs of extensions you want installed when the container is created. | ||
| "extensions": [ | ||
| "golang.Go" | ||
| ], | ||
| "containerEnv": { | ||
| // Access key of a token | ||
| "SCW_ACCESS_KEY": "${localEnv:SCW_ACCESS_KEY}", | ||
| // Secret key of a token | ||
| "SCW_SECRET_KEY": "${localEnv:SCW_SECRET_KEY}", | ||
| // Url of the API | ||
| //"SCW_API_URL": "${localEnv:SCW_API_URL}", | ||
| // Your default availability zone (fr-par-1, nl-ams-1, ...) | ||
| //"SCW_DEFAULT_ZONE": "${localEnv:SCW_DEFAULT_ZONE}", | ||
| // Your default region (fr-par, nl-ams, ...) | ||
| //"SCW_DEFAULT_REGION": "${localEnv:SCW_DEFAULT_REGION}", | ||
| // Your default project ID | ||
| "SCW_DEFAULT_PROJECT_ID": "${localEnv:SCW_DEFAULT_PROJECT_ID}", | ||
| // Your default organization ID | ||
| "SCW_DEFAULT_ORGANIZATION_ID": "${localEnv:SCW_DEFAULT_ORGANIZATION_ID}" | ||
| }, | ||
|
|
||
| // 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": "go version", | ||
|
|
||
| // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
| "remoteUser": "vscode" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: Dev Container Check | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
remyleone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Build and Run Dev Container | ||
| uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6 # v0.3.1900000417 | ||
| with: | ||
| runCmd: go run ./cmd/scw --help | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.