Commit graph

3 commits

Author SHA1 Message Date
James Paterni
e294b9b1a3 Fix Node.js executable error in Forgejo Actions workflows
Some checks failed
Build Docker Image / build (push) Failing after 31s
Minimal CI / test (push) Failing after 10s
Node+Ruby CI Pipeline / build (push) Blocked by required conditions
Node+Ruby CI Pipeline / notify (push) Blocked by required conditions
CI Pipeline / test (push) Failing after 36s
Build and Push Docker Image / test (push) Failing after 12s
Build Docker Image / notify (push) Failing after 1s
CI Pipeline / build (push) Has been skipped
Build and Push Docker Image / build (push) Has been skipped
Simple CI Pipeline / build (push) Has been skipped
CI Pipeline / notify (push) Successful in 1s
Simple CI Pipeline / notify (push) Successful in 1s
Simple CI Pipeline / test (push) Failing after 1s
Run Tests / test (push) Failing after 12s
Minimal CI / build (push) Has been skipped
Node+Ruby CI Pipeline / test (push) Has been cancelled
- Install Node.js before checkout in all workflows that use actions
- Updated ci.yml, test.yml, build.yml, and docker.yml
- Updated README.md with fix information
- Resolves "exec: node: executable file not found in $PATH" error

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:25:02 -04:00
James Paterni
95ba7f39c1 Fix Node.js executable error in Forgejo Actions
Some checks failed
Node+Ruby CI Pipeline / build (push) Blocked by required conditions
Node+Ruby CI Pipeline / notify (push) Blocked by required conditions
Build Docker Image / build (push) Failing after 2m18s
CI Pipeline / test (push) Failing after 2m18s
Build and Push Docker Image / test (push) Failing after 10s
Minimal CI / test (push) Failing after 9s
Simple CI Pipeline / test (push) Failing after 2s
Run Tests / test (push) Failing after 28s
Build Docker Image / notify (push) Failing after 1s
CI Pipeline / build (push) Has been skipped
Build and Push Docker Image / build (push) Has been skipped
Minimal CI / build (push) Has been skipped
Simple CI Pipeline / build (push) Has been skipped
CI Pipeline / notify (push) Successful in 1s
Simple CI Pipeline / notify (push) Successful in 1s
Node+Ruby CI Pipeline / test (push) Has been cancelled
## 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
James Paterni
5dcdc28356 Add Forgejo Actions workflows for CI/CD
Some checks failed
Build and Push Docker Image / test (push) Failing after 0s
Run Tests / test (push) Failing after 1s
Build and Push Docker Image / build (push) Has been skipped
Build Docker Image / build (push) Failing after 22s
Build Docker Image / notify (push) Failing after 0s
CI Pipeline / test (push) Failing after 2m13s
CI Pipeline / build (push) Has been skipped
CI Pipeline / notify (push) Successful in 1s
## Forgejo Actions Setup

### Directory Structure
- `.forgejo/workflows/` - Forgejo Actions workflows directory
- `ci.yml` - Main CI pipeline (test + build + notify)
- `test.yml` - Test-only workflow for development
- `build.yml` - Build-only workflow for releases
- `docker.yml` - Advanced Docker workflow with caching
- `README.md` - Comprehensive documentation

### Key Features

#### 1. Main CI Pipeline (ci.yml)
- Runs RSpec tests in Ruby 3.3 Alpine container
- Builds and pushes Docker images to Docker Hub
- Supports version tagging and latest tags
- Provides pipeline status notifications

#### 2. Test Workflow (test.yml)
- Dedicated testing workflow for PRs
- Runs unit and integration tests separately
- Generates coverage reports
- Uploads test artifacts

#### 3. Build Workflow (build.yml)
- Standalone Docker build workflow
- Triggers on main branch and version tags
- Includes build status notifications

#### 4. Advanced Docker Workflow (docker.yml)
- Uses Docker Buildx for advanced builds
- Implements Docker layer caching
- Automatic metadata extraction and tagging

### Forgejo vs GitHub Actions Differences

#### Technical Adaptations
- **Directory**: `.forgejo/workflows/` vs `.github/workflows/`
- **Runners**: `runs-on: docker` with container specification
- **Dependencies**: Explicit Alpine package installation
- **Caching**: Adapted for Forgejo environment
- **Execution**: Optimized for Docker container runtime

#### Compatibility
- Uses same action references (`actions/checkout@v4`, etc.)
- Same secret management (`${{ secrets.* }}`)
- Same environment variables (`${{ github.* }}`)
- Maintains workflow syntax compatibility

### Required Configuration
- Enable Repository Actions in Forgejo settings
- Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME)
- Ensure Forgejo Runner is installed and configured
- Set up action repository sources

### Benefits
- **Dual CI/CD**: Can run alongside GitHub Actions
- **Self-hosted**: Full control over CI/CD infrastructure
- **Docker-native**: Optimized for containerized workflows
- **Feature parity**: Maintains same functionality as GitHub Actions

This enables Baktainer to run on Forgejo instances with full CI/CD
capabilities while maintaining compatibility with existing GitHub Actions.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00