refactor: revert CI image approach and use standard npm ci in workflows
The CI image approach with pre-installed dependencies doesn't work with Gitea Actions due to workspace mounting issues. When Gitea Actions runs a container job, it mounts the workspace at a specific path (e.g., /workspace/david/euchre_camp), which hides the container's /app directory where dependencies were installed. Changes: - Reverted pr.yml unit-tests to use node:20-alpine with npm ci - Updated pr.yml acceptance-tests to use mcr.microsoft.com/playwright image with npm ci - Updated test.yml to use node:20-alpine with npm ci - Removed ci-image-builder.yml workflow - Removed Dockerfile.ci and build-ci-image.sh - Updated AGENTS.md and README.md to document the deprecation - Updated justfile to remove CI image commands The standard approach of running npm ci in each workflow is the recommended approach for Gitea Actions.
This commit is contained in:
@@ -129,23 +129,26 @@ DATABASE_PROVIDER=sqlite DATABASE_URL=file:./prisma/ci.db npm run test:acceptanc
|
||||
|
||||
### CI Runner Image
|
||||
|
||||
To speed up CI runs, the project uses a pre-built CI runner image with all dependencies pre-installed.
|
||||
**Note:** The CI runner image approach has been deprecated for Gitea Actions workflows.
|
||||
|
||||
**Building the CI image locally:**
|
||||
```bash
|
||||
./scripts/build-ci-image.sh [tag]
|
||||
```
|
||||
The original attempt to use a pre-built CI runner image with pre-installed dependencies encountered fundamental issues with how Gitea Actions handles workspace mounting. When Gitea Actions runs a container job, it mounts the workspace at a specific path (e.g., `/workspace/david/euchre_camp`), which hides the container's `/app` directory where dependencies were installed.
|
||||
|
||||
**Using the CI image:**
|
||||
- Workflows automatically use `ghcr.io/<repo>/ci-runner:latest` when available
|
||||
- Falls back to `node:20-alpine` if image is not found
|
||||
- Image is automatically rebuilt when `package.json` changes
|
||||
**Current Approach:**
|
||||
- Workflows use standard `node:20-alpine` or `mcr.microsoft.com/playwright` containers
|
||||
- Dependencies are installed via `npm ci` in each workflow run
|
||||
- This is the recommended approach for Gitea Actions
|
||||
|
||||
**CI Image contains:**
|
||||
- Node.js 20 Alpine
|
||||
- All npm dependencies pre-installed
|
||||
- Prisma client pre-generated
|
||||
- System tools (bash, git, python, make, g++)
|
||||
**Why the CI image approach doesn't work:**
|
||||
1. Dockerfile.ci installs dependencies in `/app`
|
||||
2. Gitea Actions mounts workspace at `/workspace/david/euchre_camp`
|
||||
3. Workspace mount hides the `/app` directory
|
||||
4. Symlinks from `/app/node_modules` don't work because `/app` is hidden
|
||||
|
||||
**Alternative for performance:**
|
||||
If CI performance becomes an issue, consider:
|
||||
- Using GitHub Actions cache for node_modules
|
||||
- Using a self-hosted runner with persistent workspace
|
||||
- Using the main Dockerfile's `test-runner` target for release workflows (which works because it builds a complete image)
|
||||
|
||||
### CI/CD Pipeline
|
||||
The project uses Gitea Actions for continuous integration:
|
||||
|
||||
Reference in New Issue
Block a user