Skip to content

Commit 38a301f

Browse files
committed
Initial commit
0 parents  commit 38a301f

File tree

237 files changed

+49814
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

237 files changed

+49814
-0
lines changed

.cargo/config.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[alias]
2+
xtask = "run --package xtask --"
3+
4+
[build]
5+
rustflags = ["--cfg", "const_slice_from_raw_parts_mut"]

.devcontainer/Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# syntax=docker/dockerfile:1
2+
3+
FROM mcr.microsoft.com/devcontainers/rust:1-1-bookworm
4+
5+
RUN <<-'EOF' bash
6+
set -eu -o pipefail
7+
apt-get update
8+
apt-get install -y --no-install-recommends ca-certificates shfmt
9+
rm -rf /var/lib/apt/lists/*
10+
EOF
11+
12+
# Install zsh and oh-my-zsh, and enable plugins
13+
RUN <<-'EOF' bash
14+
set -eu -o pipefail
15+
apt-get update
16+
apt-get install -y --no-install-recommends zsh
17+
rm -rf /var/lib/apt/lists/*
18+
[[ ! -d ~/.oh-my-zsh ]] && sh -c "$(curl -L -o- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
19+
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
20+
git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
21+
git clone --depth=1 https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
22+
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
23+
find ~/.oh-my-zsh/ -iname '.git' | xargs -I{} rm -rf {} \;
24+
sed -i'' -e 's/^plugins.*)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting zsh-completions docker)/' -e 's,^ZSH_THEME=.*,ZSH_THEME="powerlevel10k/powerlevel10k",' ~/.zshrc
25+
cp ~/.oh-my-zsh/custom/themes/powerlevel10k/config/p10k-lean.zsh ~/.p10k.zsh
26+
sed -i'' -e '/^[ ]*newline.*$/d' -e 's/\(POWERLEVEL9K_PROMPT_ADD_NEWLINE\)=.*/\1=false/g' -e 's/\(POWERLEVEL9K_TRANSIENT_PROMPT\)=.*/\1=always/g' ~/.p10k.zsh
27+
echo "[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh" >> ~/.zshrc
28+
EOF

.devcontainer/devcontainer.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
3+
{
4+
"name": "devcon",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "ghcr.io/layerresearch/devcon:1.0.0-bookworm",
7+
"features": {
8+
"ghcr.io/devcontainers/features/common-utils:2": {
9+
"installZsh": true,
10+
"configureZshAsDefaultShell": true,
11+
"installOhMyZsh": true,
12+
"installOhMyZshConfig": false,
13+
"upgradePackages": false,
14+
// username should be root and installOhMyZshConfig should be false to avoid overwriting .zshrc in the base image
15+
"username": "root"
16+
},
17+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
18+
// Docker Compose v2 is required for or compatible with the repository
19+
"dockerDashComposeVersion": "v2.29.1",
20+
// https://github.com/devcontainers/features/issues/573#issuecomment-1593854983
21+
"moby": false
22+
}
23+
},
24+
25+
// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
26+
// "mounts": [
27+
// {
28+
// "source": "devcontainer-cargo-cache-${devcontainerId}",
29+
// "target": "/usr/local/cargo",
30+
// "type": "volume"
31+
// }
32+
// ]
33+
34+
// Features to add to the dev container. More info: https://containers.dev/features.
35+
// "features": {},
36+
37+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
38+
// "forwardPorts": [],
39+
40+
// Use 'postCreateCommand' to run commands after the container is created.
41+
"postCreateCommand": "./.devcontainer/post-create",
42+
43+
// Configure tool-specific properties.
44+
"customizations": {
45+
"vscode": {
46+
"extensions": [
47+
"ms-vscode-remote.remote-containers",
48+
"rust-lang.rust-analyzer",
49+
"eamodio.gitlens",
50+
"redhat.vscode-yaml",
51+
"github.vscode-github-actions",
52+
"GitHub.vscode-codeql",
53+
"GitHub.codespaces",
54+
"GitHub.vscode-pull-request-github",
55+
"EditorConfig.EditorConfig",
56+
"NomicFoundation.hardhat-solidity"
57+
]
58+
}
59+
},
60+
61+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
62+
"remoteUser": "root",
63+
64+
"remoteEnv": {}
65+
}

.devcontainer/post-create

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env sh
2+
set -e
3+
4+
# Function to patch the code script
5+
patch_code() {
6+
# Check if the code binary path doesn't exist or if cursor handling logic is already present
7+
local bin_path="$1"
8+
[ ! -f "$bin_path" ] || grep -q 'cursor' "$bin_path" && return
9+
10+
# Insert the cursor handling logic before the specified line
11+
sed -i '/exec code-insiders/a \
12+
elif [ "$(command -v cursor)" ]; then \
13+
exec cursor "$@"' "$bin_path"
14+
15+
if [ $? -ne 0 ]; then
16+
echo "Error: Failed to insert cursor handling logic into $bin_path."
17+
fi
18+
}
19+
20+
patch_code /usr/local/bin/code

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
6+
[Makefile*]
7+
indent_style = tab
8+
9+
[Dockerfile]
10+
indent_style = tab
11+
12+
[Dockerfile.**]
13+
indent_style = tab
14+
15+
[install-dependencies]
16+
indent_style = space
17+
indent_size = 4

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
patches/** linguist-vendored
2+
doc/** linguist-vendored
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 'Dump System Information'
2+
description: 'Dump system information about the runner'
3+
4+
inputs:
5+
cpuinfo_path:
6+
description: 'Path to CPU info file'
7+
required: false
8+
default: '/proc/cpuinfo'
9+
os_release_path:
10+
description: 'Path to OS release file'
11+
required: false
12+
default: '/etc/os-release'
13+
14+
runs:
15+
using: 'composite'
16+
steps:
17+
- name: Dump runner stats
18+
shell: bash
19+
run: |
20+
echo "=== Runner System Information ==="
21+
echo "CPU Information:"
22+
echo " - Cores: $(nproc)"
23+
echo " - Model: $(grep "model name" ${{ inputs.cpuinfo_path }} | head -n1 | cut -d: -f2 | sed 's/^[ \t]*//')"
24+
echo " - Architecture: $(uname -m)"
25+
26+
echo -e "\nMemory Information:"
27+
echo " - Total RAM: $(free -h | awk '/^Mem:/{print $2}')"
28+
echo " - Available RAM: $(free -h | awk '/^Mem:/{print $7}')"
29+
echo " - Swap: $(free -h | awk '/^Swap:/{print $2}')"
30+
31+
echo -e "\nStorage Information:"
32+
echo " - Available space: $(df -h . | awk 'NR==2{print $4}')"
33+
echo " - Total space: $(df -h . | awk 'NR==2{print $2}')"
34+
echo " - Used space: $(df -h . | awk 'NR==2{print $3}')"
35+
echo " - Use percentage: $(df -h . | awk 'NR==2{print $5}')"
36+
37+
echo -e "\nOperating System:"
38+
echo " - $(cat ${{ inputs.os_release_path }} | grep PRETTY_NAME | cut -d'"' -f2)"
39+
echo " - Kernel: $(uname -r)"
40+
echo "==========================="
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: 'Install Dependencies'
2+
description: 'An action to install project dependencies'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Install dependencies
7+
run: |
8+
./install-dependencies
9+
shell: bash
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Dependency directories
2+
node_modules/
3+
jspm_packages/
4+
5+
# Optional npm cache directory
6+
.npm
7+
8+
# Optional eslint cache
9+
.eslintcache
10+
11+
# Optional REPL history
12+
.node_repl_history
13+
14+
# Output of 'npm pack'
15+
*.tgz
16+
17+
# Logs
18+
logs
19+
*.log
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
23+
24+
# Runtime data
25+
pids
26+
*.pid
27+
*.seed
28+
*.pid.lock
29+
30+
# Coverage directory used by tools like istanbul
31+
coverage/
32+
33+
# nyc test coverage
34+
.nyc_output/
35+
36+
# Compiled binary addons
37+
build/Release
38+
39+
# Dependency files
40+
package-lock.json
41+
yarn.lock
42+
43+
# Environment variables
44+
.env
45+
.env.local
46+
.env.*.local
47+
48+
# IDE specific files
49+
.idea/
50+
.vscode/
51+
*.swp
52+
*.swo
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# GNU Time Parser Action
2+
3+
A GitHub Action that parses the output of GNU's `/usr/bin/time -v` command and converts it into structured JSON data.
4+
5+
## Usage
6+
7+
Add this action to your workflow:
8+
9+
```yaml
10+
- uses: ./.github/actions/parse-gnu-time
11+
with:
12+
content: ${{ steps.bench.outputs.time_output }}
13+
```
14+
15+
## Development
16+
17+
### Install Dependencies
18+
19+
```bash
20+
npm install
21+
```
22+
23+
### Run Tests
24+
25+
```bash
26+
npm test
27+
```

0 commit comments

Comments
 (0)