Skip to content

Commit 08501c9

Browse files
committed
chore: enhance CI/CD and development workflows
- Add comprehensive GitHub Actions workflows for CI, benchmarking, and custom actions - Update devcontainer configuration with additional extensions and settings - Introduce custom actions for parsing GNU time output, dumping runner stats, and setting up benchmarks - Update Makefile with more targets and improved dependency management - Add .editorconfig for consistent code formatting - Update rust-toolchain to latest version (1.84.1) - Improve dependency installation and environment setup scripts
1 parent 29fe58e commit 08501c9

File tree

22 files changed

+11055
-208
lines changed

22 files changed

+11055
-208
lines changed

.devcontainer/devcontainer.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"configureZshAsDefaultShell": true,
1111
"installOhMyZsh": true,
1212
"installOhMyZshConfig": true,
13-
"upgradePackages": true,
13+
"upgradePackages": false,
1414
"username": "root"
1515
}
1616
},
@@ -31,21 +31,29 @@
3131
// "forwardPorts": [],
3232

3333
// Use 'postCreateCommand' to run commands after the container is created.
34-
"postCreateCommand": "rustc --version",
34+
// "postCreateCommand": "rustc --version",
3535

3636
// Configure tool-specific properties.
3737
"customizations": {
3838
"vscode": {
3939
"extensions": [
40-
"ms-vscode.makefile-tools",
4140
"ms-vscode-remote.remote-containers",
4241
"rust-lang.rust-analyzer",
4342
"eamodio.gitlens",
44-
"redhat.vscode-yaml"
43+
"redhat.vscode-yaml",
44+
"github.vscode-github-actions",
45+
"GitHub.vscode-codeql",
46+
"GitHub.codespaces",
47+
"GitHub.vscode-pull-request-github",
48+
"EditorConfig.EditorConfig"
4549
]
4650
}
4751
},
4852

4953
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
50-
"remoteUser": "root"
51-
}
54+
"remoteUser": "root",
55+
56+
"remoteEnv": {
57+
"GIT_EDITOR": "nano"
58+
}
59+
}

.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 = 2
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: 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: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
```bash
19+
npm install
20+
```
21+
22+
### Run Tests
23+
```bash
24+
npm test
25+
```
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 'Parse GNU Time Output'
2+
description: 'Parse and extract metrics from GNU time -v output'
3+
4+
inputs:
5+
content:
6+
description: 'The time command output content'
7+
required: true
8+
fields:
9+
description: 'Array of field names to include in output'
10+
required: false
11+
default: '["peak_memory_gb", "user_time_seconds", "system_time_seconds"]'
12+
13+
outputs:
14+
json:
15+
description: 'Parsed metrics in JSON format'
16+
value: ${{ steps.parse.outputs.json }}
17+
18+
runs:
19+
using: "composite"
20+
steps:
21+
- name: Install dependencies
22+
shell: bash
23+
run: cd ${{ github.action_path }} && npm ci --only=production
24+
25+
- name: Run parser
26+
id: parse
27+
shell: bash
28+
env:
29+
INPUT_CONTENT: ${{ inputs.content }}
30+
INPUT_FIELDS: ${{ inputs.fields }}
31+
run: node ${{ github.action_path }}/parse.js

0 commit comments

Comments
 (0)