baktainer/.forgejo/workflows/minimal.yml

59 lines
1.4 KiB
YAML
Raw Normal View History

Fix Node.js executable error in Forgejo Actions ## Problem Forgejo Actions failed with error: ``` OCI runtime exec failed: exec failed: unable to start container process: exec: "node": executable file not found in $PATH: unknown ``` ## Root Cause GitHub Actions like checkout@v4, cache@v4, and upload-artifact@v4 require Node.js runtime, but Ruby Alpine containers don't include Node.js by default. ## Solutions Implemented ### 1. Updated Existing Workflows - **ci.yml**: Added Node.js installation (`apk add nodejs npm`) - **test.yml**: Added Node.js installation for GitHub Actions compatibility ### 2. New Alternative Workflows - **node-ruby.yml**: Uses Node.js 18 Alpine base with Ruby installed - **simple.yml**: Shell-based workflow avoiding Node.js actions - **minimal.yml**: Minimal test-only workflow with basic shell commands ### 3. Updated Documentation - Added troubleshooting section for Node.js issues - Documented all workflow options with their trade-offs - Provided clear solutions for different use cases ## Workflow Options ### For Full GitHub Actions Support - Use `node-ruby.yml` (Node.js base + Ruby) - Use `ci.yml` or `test.yml` (Ruby base + Node.js installed) ### For Minimal Dependencies - Use `simple.yml` (shell-based, manual git/docker) - Use `minimal.yml` (basic test execution only) ### For Production - Use `node-ruby.yml` for maximum compatibility - Use `simple.yml` for minimal resource usage ## Benefits - **Multiple Options**: Choose workflow based on needs - **Backward Compatibility**: Existing workflows still work - **Minimal Alternatives**: Avoid Node.js dependency if not needed - **Clear Documentation**: Troubleshooting guide for common issues This provides flexibility to use Forgejo Actions with or without Node.js dependencies based on specific requirements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:18:12 -04:00
name: Minimal CI
on: [push]
jobs:
test:
runs-on: docker
container:
image: ruby:3.3-alpine
steps:
- name: Setup environment
run: |
apk add --no-cache git build-base libffi-dev linux-headers postgresql-dev
- name: Clone repository
run: |
git clone ${{ github.server_url }}/${{ github.repository }}.git /workspace
cd /workspace
git checkout ${{ github.sha }}
- name: Install dependencies
run: |
cd /workspace/app
gem install bundler -v 2.6.7
bundle config path vendor/bundle
bundle install
- name: Run tests
run: |
cd /workspace/app
bundle exec rspec
- name: Success
run: echo "✅ Tests completed successfully"
build:
needs: test
runs-on: docker
if: github.ref == 'refs/heads/main'
steps:
- name: Setup environment
run: |
apk add --no-cache git docker
- name: Clone repository
run: |
git clone ${{ github.server_url }}/${{ github.repository }}.git /workspace
cd /workspace
git checkout ${{ github.sha }}
- name: Build image
run: |
cd /workspace
docker build -t test-image .
- name: Success
run: echo "✅ Build completed successfully"