Compare commits
13 Commits
v0.1.3
...
7ee336c51c
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ee336c51c | |||
| d24e810ad1 | |||
| 397594a9df | |||
| 4116884f9f | |||
| b445d9044a | |||
| 81c93bafc1 | |||
| ba180ae6e1 | |||
| c611c68822 | |||
| 4c2687498f | |||
| 3983049d2c | |||
| 941d857feb | |||
| b686c3673e | |||
| dfd66cde0b |
@@ -13,10 +13,6 @@ jobs:
|
|||||||
options: --user root
|
options: --user root
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install system dependencies
|
|
||||||
run: |
|
|
||||||
apk add --no-cache bash git
|
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -30,7 +26,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: unit-tests
|
needs: unit-tests
|
||||||
container:
|
container:
|
||||||
image: node:20-alpine
|
image: mcr.microsoft.com/playwright:v1.58.0-jammy
|
||||||
options: --user root
|
options: --user root
|
||||||
env:
|
env:
|
||||||
DATABASE_PROVIDER: sqlite
|
DATABASE_PROVIDER: sqlite
|
||||||
@@ -38,18 +34,21 @@ jobs:
|
|||||||
BETTER_AUTH_SECRET: test-secret-key-for-ci-only
|
BETTER_AUTH_SECRET: test-secret-key-for-ci-only
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install system dependencies
|
|
||||||
run: |
|
|
||||||
apk add --no-cache bash git
|
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Generate Prisma client
|
- name: Generate Prisma client
|
||||||
run: npx prisma generate
|
run: npx prisma generate
|
||||||
|
env:
|
||||||
|
DATABASE_URL: postgresql://user:pass@localhost:5432/dummy
|
||||||
|
|
||||||
- name: Setup SQLite database
|
- name: Setup SQLite database
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -80,8 +80,12 @@ jobs:
|
|||||||
- name: Commit version bump
|
- name: Commit version bump
|
||||||
run: |
|
run: |
|
||||||
git add package.json CHANGELOG.md
|
git add package.json CHANGELOG.md
|
||||||
git commit -m "chore: bump version to v${{ steps.version.outputs.new_version }}"
|
if git diff --cached --quiet; then
|
||||||
git push origin main
|
echo "No changes to commit (version may already be at target version)"
|
||||||
|
else
|
||||||
|
git commit -m "chore: bump version to v${{ steps.version.outputs.new_version }}"
|
||||||
|
git push origin main
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Create git tag for release
|
- name: Create git tag for release
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ jobs:
|
|||||||
if: "!contains(github.event.head_commit.message, 'chore: bump version')"
|
if: "!contains(github.event.head_commit.message, 'chore: bump version')"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install system dependencies
|
|
||||||
run: |
|
|
||||||
apk add --no-cache bash git
|
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
|||||||
@@ -127,6 +127,29 @@ npm run db:setup-postgres
|
|||||||
DATABASE_PROVIDER=sqlite DATABASE_URL=file:./prisma/ci.db npm run test:acceptance
|
DATABASE_PROVIDER=sqlite DATABASE_URL=file:./prisma/ci.db npm run test:acceptance
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### CI Runner Image
|
||||||
|
|
||||||
|
**Note:** The CI runner image approach has been deprecated for Gitea Actions workflows.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
**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
|
||||||
|
|
||||||
|
**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
|
### CI/CD Pipeline
|
||||||
The project uses Gitea Actions for continuous integration:
|
The project uses Gitea Actions for continuous integration:
|
||||||
|
|
||||||
|
|||||||
@@ -368,10 +368,27 @@ The application uses Gitea Actions for continuous integration and deployment:
|
|||||||
- Unit tests for quick feedback
|
- Unit tests for quick feedback
|
||||||
- Skips auto-generated version bumps
|
- Skips auto-generated version bumps
|
||||||
|
|
||||||
3. **Release Workflow** (`.gitea/workflows/release.yml`): Runs on main branch pushes
|
3. **Release Workflow** (`.gitea/workflows/release.yml`): Runs on main branch pushes
|
||||||
- Version bumping and tagging
|
- Version bumping and tagging
|
||||||
- Docker image building and testing
|
- Docker image building and testing
|
||||||
- Registry push and deployment
|
- Registry push and deployment
|
||||||
|
|
||||||
|
### CI Runner Image
|
||||||
|
|
||||||
|
**Note:** The CI runner image approach has been deprecated for Gitea Actions workflows.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
**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
|
||||||
|
|
||||||
|
**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
|
||||||
|
|
||||||
### Database Strategy for CI
|
### Database Strategy for CI
|
||||||
- **CI Tests**: SQLite database (fast, no server required)
|
- **CI Tests**: SQLite database (fast, no server required)
|
||||||
|
|||||||
@@ -246,6 +246,8 @@ workflow-status:
|
|||||||
@echo "PR Workflow: Runs unit + acceptance tests on pull requests"
|
@echo "PR Workflow: Runs unit + acceptance tests on pull requests"
|
||||||
@echo "Test Workflow: Runs unit tests on all branch pushes"
|
@echo "Test Workflow: Runs unit tests on all branch pushes"
|
||||||
@echo "Release Workflow: Runs on main branch pushes (version bump + Docker build)"
|
@echo "Release Workflow: Runs on main branch pushes (version bump + Docker build)"
|
||||||
|
@echo ""
|
||||||
|
@echo "Note: CI image approach deprecated due to Gitea Actions workspace mounting"
|
||||||
|
|
||||||
# Check current database provider
|
# Check current database provider
|
||||||
db-status:
|
db-status:
|
||||||
|
|||||||
+38
-28
@@ -175,37 +175,47 @@ function main() {
|
|||||||
console.log(`New version: ${currentVersion} → ${newVersion}`);
|
console.log(`New version: ${currentVersion} → ${newVersion}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Confirm with user
|
// Confirm with user (or skip if --yes flag is set)
|
||||||
const readline = require('readline');
|
if (skipConfirm) {
|
||||||
const rl = readline.createInterface({
|
// Update package.json
|
||||||
input: process.stdin,
|
updatePackageJson(newVersion);
|
||||||
output: process.stdout
|
|
||||||
});
|
|
||||||
|
|
||||||
rl.question(`\nApply version ${newVersion}? (y/N) `, (answer) => {
|
// Update changelog
|
||||||
if (answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes') {
|
if (bumpType !== 'custom') {
|
||||||
// Update package.json
|
const commits = getCommitsSinceLastTag();
|
||||||
updatePackageJson(newVersion);
|
updateChangelog(newVersion, commits, bumpType);
|
||||||
|
|
||||||
// Update changelog
|
|
||||||
if (bumpType !== 'custom') {
|
|
||||||
const commits = getCommitsSinceLastTag();
|
|
||||||
updateChangelog(newVersion, commits, bumpType);
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`\n✅ Version bumped to ${newVersion}`);
|
|
||||||
console.log(`\nNext steps:`);
|
|
||||||
console.log(` 1. Review changes: git diff`);
|
|
||||||
console.log(` 2. Commit changes: git commit -am "chore: bump version to v${newVersion}"`);
|
|
||||||
console.log(` 3. Create tag: git tag -a v${newVersion} -m "Release v${newVersion}"`);
|
|
||||||
console.log(` 4. Push changes: git push origin main`);
|
|
||||||
console.log(` 5. Push tag: git push origin v${newVersion}`);
|
|
||||||
} else {
|
|
||||||
console.log('❌ Version bump cancelled');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rl.close();
|
console.log(`\n✅ Version bumped to ${newVersion}`);
|
||||||
});
|
process.exit(0);
|
||||||
|
} else {
|
||||||
|
const readline = require('readline');
|
||||||
|
const rl = readline.createInterface({
|
||||||
|
input: process.stdin,
|
||||||
|
output: process.stdout
|
||||||
|
});
|
||||||
|
|
||||||
|
rl.question(`\nApply version ${newVersion}? (y/N) `, (answer) => {
|
||||||
|
if (answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes') {
|
||||||
|
// Update package.json
|
||||||
|
updatePackageJson(newVersion);
|
||||||
|
|
||||||
|
// Update changelog
|
||||||
|
if (bumpType !== 'custom') {
|
||||||
|
const commits = getCommitsSinceLastTag();
|
||||||
|
updateChangelog(newVersion, commits, bumpType);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`\n✅ Version bumped to ${newVersion}`);
|
||||||
|
process.exit(0);
|
||||||
|
} else {
|
||||||
|
console.log('❌ Version bump cancelled');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
rl.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run main function
|
// Run main function
|
||||||
|
|||||||
Reference in New Issue
Block a user