fix: Use nektos/act instead of gitea/act_runner for local testing
gitea/act_runner is a runner daemon that needs to connect to a Gitea instance, not a local testing tool. nektos/act is the correct tool for running workflows locally, and it's compatible with both GitHub Actions and Gitea Actions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
|
||||
## test-ci-locally.sh
|
||||
|
||||
Tests the Gitea Actions workflow locally using `act_runner` in Docker.
|
||||
Tests the Gitea Actions workflow locally using `act` (nektos/act) in Docker.
|
||||
|
||||
### Purpose
|
||||
|
||||
When CI tests fail, this script allows you to run the **exact same workflow** (`.gitea/workflows/magnitude.yml`) locally to debug issues without repeatedly pushing to trigger CI runs. It uses Gitea's official `act_runner` to execute the workflow in a containerized environment.
|
||||
When CI tests fail, this script allows you to run the **exact same workflow** (`.gitea/workflows/magnitude.yml`) locally to debug issues without repeatedly pushing to trigger CI runs. It uses `nektos/act` to execute the workflow in a containerized environment, just like GitHub Actions or Gitea Actions would.
|
||||
|
||||
### Usage
|
||||
|
||||
@@ -17,11 +17,11 @@ When CI tests fail, this script allows you to run the **exact same workflow** (`
|
||||
### What it does
|
||||
|
||||
1. Loads environment variables from `.env` file
|
||||
2. Runs `gitea/act_runner:latest` Docker container with:
|
||||
- Docker socket mounted (so act_runner can create containers)
|
||||
2. Runs `nektos/act:latest` Docker container with:
|
||||
- Docker socket mounted (so act can create containers)
|
||||
- Current directory mounted as workspace
|
||||
- Secrets passed from `.env` file
|
||||
3. Executes `.gitea/workflows/magnitude.yml` using act_runner's `exec` command
|
||||
3. Executes `.gitea/workflows/magnitude.yml` using act
|
||||
4. The workflow then runs its steps:
|
||||
- Checkout code
|
||||
- Create .env file with secrets
|
||||
@@ -38,10 +38,10 @@ When CI tests fail, this script allows you to run the **exact same workflow** (`
|
||||
|
||||
### How It Works
|
||||
|
||||
The script uses Gitea's act_runner to execute the workflow YAML file. Act_runner creates containers according to the workflow definition, which in turn uses `docker-compose.ci.yml` to set up the test environment:
|
||||
The script uses `nektos/act` to execute the workflow YAML file. Act is compatible with both GitHub Actions and Gitea Actions workflows. It creates containers according to the workflow definition, which in turn uses `docker-compose.ci.yml` to set up the test environment:
|
||||
|
||||
```
|
||||
act_runner (Docker container)
|
||||
act (nektos/act Docker container)
|
||||
↓ executes .gitea/workflows/magnitude.yml
|
||||
↓ which runs docker-compose with:
|
||||
magnitude (Playwright container)
|
||||
@@ -51,6 +51,12 @@ nextjs (Node.js container running pnpm dev)
|
||||
surrealdb (SurrealDB container)
|
||||
```
|
||||
|
||||
### Note on nektos/act vs gitea/act_runner
|
||||
|
||||
- `nektos/act` is designed for local workflow testing and is compatible with both GitHub Actions and Gitea Actions
|
||||
- `gitea/act_runner` is a runner daemon that needs to connect to a Gitea instance and is not designed for offline local testing
|
||||
- This script uses `nektos/act` which provides the local testing experience similar to running workflows in CI
|
||||
|
||||
### Debugging CI Failures
|
||||
|
||||
If Gitea Actions fail:
|
||||
|
||||
Reference in New Issue
Block a user