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

feat(devcontainer): prebuild plan #4

Merged
merged 6 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 10 additions & 22 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
{
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml"
],
"settings": {
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer",
"editor.formatOnSave": true
},
"explorer.excludeGitIgnore": true,
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/target/**": true
}
}
}
"containerEnv": {
"CARGO_HOME": "/cargo-cache"
},
"containerUser": "${localEnv:DEV_USERNAME}",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"configureZshAsDefaultShell": false,
Expand All @@ -35,7 +19,7 @@
"mounts": [
{
"source": "devcontainer-cargo-cache-${devcontainerId}",
"target": "/usr/local/cargo",
"target": "/cargo-cache",
"type": "volume"
},
{
Expand All @@ -47,6 +31,10 @@
"name": "${localWorkspaceFolderBasename}-rust",
"overrideCommand": true,
"privileged": false,
"workspaceFolder": "/workspace",
"containerUser": "swelio"
"runArgs": [
"--security-opt=no-new-privileges",
"--userns=keep-id"
],
"updateRemoteUserUID": true,
"workspaceFolder": "/workspace"
}
38 changes: 38 additions & 0 deletions .github/.devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml"
],
"settings": {
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer",
"editor.formatOnSave": true
},
"explorer.excludeGitIgnore": true,
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/target/**": true
},
"rust-analyzer.check.command": "clippy"
}
}
},
"features": {
"ghcr.io/swelio/dev-images/apt-install:latest": {
"packages": "build-essential libssl-dev openssl pkg-config"
},
"ghcr.io/swelio/dev-images/cargo-tools:latest": {
"tools": "cargo-generate cocogitto drill git-cliff hyperfine"
},
"ghcr.io/swelio/dev-images/rustup:latest": {
"components": "clippy rust-src rustfmt"
}
},
"image": "rust:slim-bookworm",
"overrideCommand": true,
"privileged": false,
"workspaceFolder": "/workspace"
}
20 changes: 20 additions & 0 deletions .github/workflows/devcontainer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Devcontainer prebuilding

on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- .github/.devcontainer.json
pull_request:
branches:
- 'main'
paths:
- .github/.devcontainer.json
schedule:
- cron: '59 23 * * FRI'

jobs:
pre-build:
uses: Swelio/continuous-integration/.github/workflows/devcontainer-prebuild.yaml@main
Loading