Skip to content

Commit fd291e7

Browse files
authored
feat: add mise as alternative to Volta for Node.js version management (#3)
* improve ubuntu management * adding some basic checks * add fail-fast * Address CodeRabbit review comments - Add fail-fast safety with set -euo pipefail in action.yml - Normalize package lists to space-separated strings to handle multiline YAML - Script already exports GitHub Actions outputs correctly (configured, installed, codename) - Remove retry_strategy matrix and fix runner configurations * chore: trigger CI pipeline to test zondax-runners * change mirror order * Migrates workflows to ubuntu-latest runners Updates workflows to use the standard 'ubuntu-latest' runner instead of the custom 'zondax-runners'. This simplifies workflow management and leverages a more widely supported and maintained environment. * Ensures commands are run with sudo Prefixes apt-get commands with sudo to ensure they are run with root privileges, resolving potential permission issues during package installation and updates. * chore: disable Node.js environment test workflow by renaming file * Improves package installation and testing Changes the workflow to not cancel in progress jobs. The htop version check is improved to always output if htop is installed. Also, the script now uses sudo when copying the sources.list file and writing to it, which fixes issues related to permissions. * Enables node24 installation workflow Re-enables the node24 installation workflow by renaming the `.disabled` file, allowing it to run during CI/CD processes. * Updates runners for CI workflows Changes the `runs-on` field in CI workflows to use Zondax runners. This should provide a more consistent and reliable environment for running CI tests. * feat: add lockfile creation for yarn, pnpm, and bun package managers * feat: add lockfile modification control for package manager installations * ci: enable lockfile modifications in Node.js 24 installation workflow * ci: disable dependency installation and lockfile modifications in Node.js setup * fix: update yarn config check to support Yarn v4 compatibility * refactor: remove test project structure and handle yarn v4 script execution separately * chore: remove test execution and performance benchmarking steps from Node24 workflow * refactor: remove redundant dependency testing step from Node 24 installation workflow * refactor: simplify Node.js and Ubuntu workflow files by removing verbose logging and checks * Implements generic rclone action for S3/MinIO Introduces a reusable rclone action that supports various operations such as copy (caching), sync, move, delete, and size, with S3/MinIO backend. This action provides a flexible and efficient way to manage files and directories in cloud storage, with features such as: - Backward compatibility with existing cache workflows - Input validation and credential masking for enhanced security - Structured logging and transfer statistics for monitoring and analysis - Retry logic with exponential backoff for improved reliability * feat: upgrade to Next.js 15.3.5 and React 19.1.0 - Upgrade Next.js from 14.2.30 to 15.3.5 for latest features and performance - Upgrade React and React DOM to 19.1.0 for Next.js 15 compatibility - Update React types to 19.1.8 for proper TypeScript support - Prepare for async Request APIs transformation * fix: handle YAML list markers and unquoted package lists in apt-get install * fix: use git config --global instead of --system for safe directory settings * feat: add mise as alternative to Volta for Node.js version management * fix: add github token to mise-action configuration for authentication * fix: remove unnecessary github_token from mise-action setup * refactor: remove Volta support and improve rclone options handling with arrays
1 parent 7fcd7cd commit fd291e7

File tree

13 files changed

+2834
-374
lines changed

13 files changed

+2834
-374
lines changed

.github/workflows/install-node24.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Node.js Action
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
schedule:
10+
# Run comprehensive tests daily at 1 AM UTC
11+
- cron: '0 1 * * *'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
test-node-environment:
19+
name: Node ${{ matrix.node_version }} | ${{ matrix.package_manager }}
20+
runs-on: zondax-runners
21+
strategy:
22+
fail-fast: true
23+
matrix:
24+
# Multi-dimensional matrix with Node versions, package managers, and runner types
25+
node_version:
26+
- '22'
27+
- '24'
28+
package_manager:
29+
- npm
30+
- yarn
31+
- pnpm
32+
- bun
33+
timeout-minutes: 15
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
38+
39+
- name: Setup Node.js ${{ matrix.node_version }} with ${{ matrix.package_manager }}
40+
id: setup-node
41+
uses: ./setup-node-env
42+
with:
43+
node_version: ${{ matrix.node_version }}
44+
package_manager: ${{ matrix.package_manager }}
45+
cache_dependencies: true
46+
install_deps: false
47+
autoinit_env: false
48+
49+
- name: Verify Installation
50+
run: |
51+
# Check Node.js
52+
node_version=$(node --version)
53+
echo "Node.js: $node_version"
54+
[[ "$node_version" == v${{ matrix.node_version }}.* ]] || exit 1
55+
56+
# Check package manager
57+
case "${{ matrix.package_manager }}" in
58+
npm) npm --version ;;
59+
yarn) yarn --version ;;
60+
pnpm) pnpm --version ;;
61+
bun) bun --version ;;
62+
esac
63+
64+
echo "✅ Node.js ${{ matrix.node_version }} + ${{ matrix.package_manager }} working!"
65+
66+

.github/workflows/install-ubuntu.yml

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
name: Ubuntu Action
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
schedule:
10+
# Run comprehensive Ubuntu tests daily at 2 AM UTC
11+
- cron: '0 2 * * *'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: false
16+
17+
jobs:
18+
test-ubuntu-packages:
19+
name: ${{ matrix.packages }}
20+
runs-on: zondax-runners
21+
strategy:
22+
fail-fast: true
23+
matrix:
24+
packages:
25+
- 'wget'
26+
- 'wget curl git vim htop'
27+
mirror_config:
28+
- enable: true
29+
name: "swiss-mirrors"
30+
- enable: false
31+
name: "default-mirrors"
32+
timeout-minutes: 15
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Setup packages for testing
38+
id: packages
39+
run: |
40+
echo "🎯 Testing packages: ${{ matrix.packages }}"
41+
packages="${{ matrix.packages }}"
42+
echo "packages=$packages" >> $GITHUB_OUTPUT
43+
echo "📦 Packages to install: $packages"
44+
45+
- name: System information
46+
run: |
47+
echo "🖥️ System Information for Zondax Runners"
48+
echo "=================================================="
49+
echo "Runner: zondax-runners"
50+
echo "Packages: ${{ matrix.packages }}"
51+
echo "Mirror config: ${{ matrix.mirror_config.name }}"
52+
echo "Cache policy: with-update"
53+
echo ""
54+
55+
# System specs
56+
echo "🔧 Hardware specs:"
57+
echo "CPU cores: $(nproc)"
58+
echo "Memory: $(free -h | grep '^Mem:' | awk '{print $2}')"
59+
echo "Disk space: $(df -h / | tail -1 | awk '{print $4}') available"
60+
echo "Architecture: $(uname -m)"
61+
echo ""
62+
63+
# Ubuntu details
64+
echo "🐧 Ubuntu details:"
65+
lsb_release -a 2>/dev/null || cat /etc/os-release
66+
echo ""
67+
68+
# Network connectivity
69+
echo "🌐 Network connectivity:"
70+
ping -c 1 google.com >/dev/null && echo "✅ Internet connectivity" || echo "❌ No internet"
71+
72+
# Check if running on Zondax infrastructure
73+
echo "🇨🇭 Running on Zondax Swiss infrastructure"
74+
75+
- name: Install packages (${{ matrix.packages }})
76+
id: install-packages
77+
uses: ./setup-ubuntu-packages
78+
with:
79+
packages: ${{ steps.packages.outputs.packages }}
80+
enable_mirrors: ${{ matrix.mirror_config.enable }}
81+
update_cache: true
82+
retry_count: 3
83+
cache_timeout: 300
84+
85+
- name: Verify package installation
86+
run: |
87+
echo "✅ Verifying package installation for ${{ matrix.packages }}"
88+
echo "Mirror configured: ${{ steps.install-packages.outputs.mirror_configured }}"
89+
echo "Packages installed: ${{ steps.install-packages.outputs.packages_installed }}"
90+
echo "Ubuntu codename: ${{ steps.install-packages.outputs.ubuntu_codename }}"
91+
echo ""
92+
93+
# Test installed packages
94+
echo "🧪 Testing installed packages..."
95+
for package in ${{ steps.packages.outputs.packages }}; do
96+
case "$package" in
97+
wget)
98+
wget --version | head -1
99+
;;
100+
curl)
101+
curl --version | head -1
102+
;;
103+
git)
104+
git --version
105+
;;
106+
vim)
107+
vim --version | head -1
108+
;;
109+
htop)
110+
echo "htop: $(which htop)" && htop --version 2>/dev/null || echo "htop: installed but version check failed"
111+
;;
112+
*)
113+
echo "Testing: $package (generic test)"
114+
command -v "$package" && echo "✅ $package is available" || echo "❌ $package not found"
115+
;;
116+
esac
117+
done
118+
119+
- name: Performance benchmarking
120+
run: |
121+
echo "📊 Performance Analysis"
122+
echo "======================"
123+
echo "Runner type: zondax-runners"
124+
echo "Packages: ${{ matrix.packages }}"
125+
echo "Mirror configuration: ${{ matrix.mirror_config.name }}"
126+
echo "Cache policy: with-update"
127+
echo ""
128+
129+
# Performance analysis based on mirror configuration
130+
if [ "${{ matrix.mirror_config.enable }}" = "true" ]; then
131+
echo "🇨🇭 Swiss Mirror Performance:"
132+
echo "- Primary: Init7 (https://mirror.init7.net/ubuntu/)"
133+
echo "- Fallback: ETH Zurich (https://ubuntu.ethz.ch/ubuntu/)"
134+
if [ "${{ steps.install-packages.outputs.mirror_configured }}" = "true" ]; then
135+
echo "✅ Swiss mirrors used successfully"
136+
elif [ "${{ steps.install-packages.outputs.mirror_configured }}" = "fallback" ]; then
137+
echo "⚠️ Fallback mirrors were used"
138+
else
139+
echo "❌ Mirror configuration failed"
140+
fi
141+
else
142+
echo "🌍 Default Mirror Performance:"
143+
echo "- Using standard Ubuntu repositories"
144+
echo "- May be slower in Swiss datacenters"
145+
fi
146+
147+
echo ""
148+
149+
# Runner-specific performance expectations
150+
echo "🏃‍♂️ Zondax Runner Performance:"
151+
echo "- Running on Swiss datacenter infrastructure"
152+
echo "- Optimized for: Development workflows and CI/CD"
153+
echo "- Expected performance: Excellent for package installation"
154+
155+
# Package complexity analysis
156+
package_count=$(echo "${{ steps.packages.outputs.packages }}" | wc -w)
157+
if [ "$package_count" -eq 1 ]; then
158+
echo "📦 Package Complexity: Low - Single package installation"
159+
elif [ "$package_count" -le 3 ]; then
160+
echo "📦 Package Complexity: Medium - Few packages to install"
161+
else
162+
echo "📦 Package Complexity: High - Multiple packages to install"
163+
fi
164+
165+
- name: Swiss infrastructure testing
166+
run: |
167+
echo "🇨🇭 Zondax Swiss Infrastructure Validation"
168+
echo "==========================================="
169+
170+
# Test geographic performance advantages
171+
echo "🌍 Geographic performance testing..."
172+
173+
# Test latency to Swiss mirrors
174+
if command -v ping >/dev/null; then
175+
echo "📡 Testing latency to Swiss mirrors:"
176+
177+
# Test Init7 mirror
178+
init7_latency=$(ping -c 3 mirror.init7.net 2>/dev/null | tail -1 | cut -d'/' -f5 2>/dev/null || echo "N/A")
179+
echo " Init7 mirror: ${init7_latency}ms"
180+
181+
# Test ETH Zurich mirror
182+
ethz_latency=$(ping -c 3 ubuntu.ethz.ch 2>/dev/null | tail -1 | cut -d'/' -f5 2>/dev/null || echo "N/A")
183+
echo " ETH Zurich mirror: ${ethz_latency}ms"
184+
185+
# Test default Ubuntu mirror for comparison
186+
ubuntu_latency=$(ping -c 3 archive.ubuntu.com 2>/dev/null | tail -1 | cut -d'/' -f5 2>/dev/null || echo "N/A")
187+
echo " Default Ubuntu mirror: ${ubuntu_latency}ms"
188+
fi
189+
190+
# Swiss datacenter advantages
191+
echo ""
192+
echo "🏢 Swiss Datacenter Advantages:"
193+
echo "✅ GDPR compliance by design"
194+
echo "✅ Swiss data protection laws"
195+
echo "✅ Low latency to European services"
196+
echo "✅ High-quality network infrastructure"
197+
echo "✅ Reliable power and connectivity"
198+
199+
- name: Test summary and metrics
200+
run: |
201+
echo "📋 Test Summary for ${{ matrix.packages }}"
202+
echo "============================================"
203+
echo "✅ Runner type: zondax-runners"
204+
echo "✅ Packages: ${{ matrix.packages }}"
205+
echo "✅ Mirror configuration: ${{ matrix.mirror_config.name }}"
206+
echo "✅ Cache policy: with-update"
207+
echo "✅ Mirror status: ${{ steps.install-packages.outputs.mirror_configured }}"
208+
echo ""
209+
210+
# Final system state
211+
echo "🔍 Final System State:"
212+
echo "Load average: $(uptime | cut -d',' -f3- | xargs)"
213+
echo "Memory usage: $(free | grep Mem | awk '{printf \"%.1f%%\\n\", $3/$2*100}')"
214+
echo "Disk usage: $(df / | tail -1 | awk '{print $5}')"
215+
216+
# Package count verification
217+
installed_count=$(echo "${{ steps.install-packages.outputs.packages_installed }}" | wc -w)
218+
expected_count=$(echo "${{ steps.packages.outputs.packages }}" | wc -w)
219+
220+
echo ""
221+
echo "📦 Package Installation Summary:"
222+
echo "Expected packages: $expected_count"
223+
echo "Reported installed: $installed_count"
224+
225+
if [ "$installed_count" -ge "$expected_count" ]; then
226+
echo "✅ All expected packages appear to be installed"
227+
else
228+
echo "⚠️ Package count mismatch - may include dependencies"
229+
fi
230+
231+
echo ""
232+
echo "🎉 All tests completed successfully on zondax-runners!"

0 commit comments

Comments
 (0)