-
-
Notifications
You must be signed in to change notification settings - Fork 47k
Fix devcontainer build failure #12837
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
Merged
+97
−6
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bbcf757
add post-installation script
bertrand-awz 17f4017
set zsh as default terminal and make post-install execution on postcr…
bertrand-awz 68b7d61
rename file
bertrand-awz b316abd
rename script
bertrand-awz ce69252
Create devcontainers_ci.yml
bertrand-awz 1df076d
Update devcontainer.json
bertrand-awz 492a88d
Update devcontainers_ci.yml
bertrand-awz 9392da3
postCreateCommand update to reflect that the shell script has been re…
bertrand-awz 9b50212
update devcontainer readme file
bertrand-awz 0247279
trigger workflow only on devcontainer/** changes
bertrand-awz 2071bc7
Merge branch 'test-gh-action-for-devcontainer'
bertrand-awz df199b3
prettier refactor
bertrand-awz 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
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 |
---|---|---|
@@ -1 +1,42 @@ | ||
https://code.visualstudio.com/docs/devcontainers/tutorial | ||
# Development Container | ||
|
||
This is **Devcontainer** configuration to provide a consistent development environment for all contributors. | ||
|
||
## Features | ||
|
||
- [x] Pre-configured **Python environment** | ||
- [x] Automatic installation of **pre-commit hooks** | ||
- [x] **Ruff** linter ready to check your code | ||
- [x] **Oh My Zsh** with plugins: | ||
- `zsh-autosuggestions` | ||
- `zsh-syntax-highlighting` | ||
|
||
## Usage | ||
|
||
1. Install [**Docker** ](https://www.docker.com/get-started/) and [**Visual Studio Code**](https://code.visualstudio.com/) | ||
2. Install the **Remote - Containers** extension in VS Code | ||
|
||
- Do `CTRL+P`, paste this command and press `Enter` | ||
|
||
```shell | ||
ext install ms-vscode-remote.remote-containers | ||
``` | ||
3. Open this repository in VS Code | ||
4. When prompted, click **"Reopen in Container"** | ||
5. Wait for the environment to build and initialize | ||
|
||
After setup: | ||
|
||
- `pre-commit` hooks are installed | ||
- `ruff` and other tools are available | ||
- The shell uses Zsh by default | ||
|
||
## Tips | ||
|
||
To manually run checks on all files: | ||
|
||
```bash | ||
pre-commit run --all-files | ||
``` | ||
|
||
> For further information here's [Microsoft tutorial about devcontainers.](https://code.visualstudio.com/docs/devcontainers/tutorial) |
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,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Begin post-installation steps..." | ||
|
||
set -e | ||
|
||
echo "Installing pre-commit hooks..." | ||
pre-commit install | ||
|
||
echo "Installing Oh My Zsh plugins..." | ||
|
||
# Install zsh-autosuggestions if not present | ||
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" ]; then | ||
echo "Cloning zsh-autosuggestions..." | ||
git clone https://github.com/zsh-users/zsh-autosuggestions \ | ||
"${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" | ||
fi | ||
|
||
# Install zsh-syntax-highlighting if not present | ||
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting" ]; then | ||
echo "Cloning zsh-syntax-highlighting..." | ||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \ | ||
"${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting" | ||
fi | ||
|
||
echo "Configuring plugins in ~/.zshrc..." | ||
sed -i '/^plugins=/c\plugins=(git zsh-autosuggestions zsh-syntax-highlighting)' ~/.zshrc | ||
|
||
echo "Post-installation steps completed successfully. Enjoy!" |
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,19 @@ | ||
name: Test DevContainer Build | ||
|
||
on: | ||
push: | ||
paths: | ||
- ".devcontainer/**" | ||
pull_request: | ||
paths: | ||
- ".devcontainer/**" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: devcontainers/[email protected] | ||
with: | ||
push: never | ||
runCmd: "true" |
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.