-
Notifications
You must be signed in to change notification settings - Fork 8
[chore] Fix GitHub Actions #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9aab66b
4f5bc5a
90ad262
7729d1e
649958d
853236a
669bdbf
75c37fb
1312b1d
8ea2679
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: Test backend installation | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - develop | ||
| - main | ||
| paths: | ||
| - '**.py' | ||
| - '**.txt' | ||
| - '**/pyproject.toml' | ||
| - '**/uv.lock' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| checks: read | ||
| contents: read | ||
|
|
||
| jobs: | ||
| installation-backend: | ||
| name: Test backend installation | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out Git repository | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up Python environment | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.11" | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
Comment on lines
+27
to
+31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The - name: Set up Python environment
uses: actions/setup-python@v6
with:
python-version: "3.11" |
||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v6 | ||
| with: | ||
| version: "latest" | ||
| enable-cache: true | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --locked --all-extras --dev --project backend-agent | ||
|
|
||
| - name: Start server and check health | ||
| working-directory: backend-agent | ||
| run: | | ||
| DISABLE_AGENT=1 DB_PATH=${RUNNER_TEMP}/data.db uv run main.py > server.log 2>&1 & | ||
| for i in {1..20}; do | ||
| sleep 1 | ||
| status=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/health || true) | ||
| if [ "$status" -eq 200 ]; then | ||
| echo "Health check succeeded" | ||
| cat server.log | ||
| exit 0 | ||
| fi | ||
| done | ||
|
Comment on lines
+46
to
+54
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using a more explicit health check URL and add timeout handling for the curl command to prevent hanging. for i in {1..20}; do
sleep 1
status=$(timeout 5 curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/health 2>/dev/null || echo "000")
if [ "$status" -eq 200 ]; then
echo "Health check succeeded"
cat server.log
exit 0
fi
echo "Attempt $i: Health check returned status $status"
done |
||
| echo "Health check failed after waiting" | ||
| cat server.log | ||
| exit 1 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| name: Test frontend installation | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - develop | ||
| - main | ||
| paths: | ||
| - 'frontend/package*.json' | ||
| - 'frontend/**.ts' | ||
| - 'frontend/**.js' | ||
| - 'frontend/**.json' | ||
| - 'frontend/**.css' | ||
| - 'frontend/**.html' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| checks: read | ||
| contents: read | ||
|
|
||
| jobs: | ||
| installation-frontend: | ||
| name: Test frontend installation | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out Git repository | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up Node.js environment | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: "24" | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: frontend | ||
| run: npm ci | ||
|
|
||
| - name: Build frontend | ||
| working-directory: frontend | ||
| run: npm run build | ||
|
|
||
| - name: Verify build artifacts | ||
| working-directory: frontend | ||
| run: | | ||
| if [ -d "dist/" ]; then | ||
| echo "Build artifacts found in dist/" | ||
| ls -la dist/ | ||
| else | ||
| echo "Build artifacts not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Test dev server startup | ||
| working-directory: frontend | ||
| timeout-minutes: 2 | ||
| run: | | ||
| # Start the dev server in background | ||
| npm start & | ||
| DEV_SERVER_PID=$! | ||
|
|
||
| # Wait for server to be ready (max 60 seconds) | ||
| for i in {1..60}; do | ||
| sleep 1 | ||
| if curl -f -s http://localhost:4200 > /dev/null 2>&1; then | ||
| echo "Dev server started successfully" | ||
| kill $DEV_SERVER_PID | ||
| exit 0 | ||
| fi | ||
| done | ||
|
|
||
| echo "Dev server failed to start within 60 seconds" | ||
| kill $DEV_SERVER_PID | ||
| exit 1 | ||
|
Comment on lines
+57
to
+73
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The process cleanup logic could be improved to handle cases where the kill command fails. Consider using a more robust cleanup approach. # Start the dev server in background
npm start &
DEV_SERVER_PID=$!
# Cleanup function
cleanup() {
if kill -0 $DEV_SERVER_PID 2>/dev/null; then
kill $DEV_SERVER_PID 2>/dev/null || true
wait $DEV_SERVER_PID 2>/dev/null || true
fi
}
trap cleanup EXIT
# Wait for server to be ready (max 60 seconds)
for i in {1..60}; do
sleep 1
if curl -f -s http://localhost:4200 > /dev/null 2>&1; then
echo "Dev server started successfully"
exit 0
fi
done
echo "Dev server failed to start within 60 seconds"
exit 1
Comment on lines
+72
to
+73
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The file is missing a newline at the end. This should be added for better POSIX compliance. kill $DEV_SERVER_PID
exit 1 |
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ on: | |
| - main | ||
| paths: | ||
| - '**.py' | ||
| - 'CHANGELOG.md' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,10 @@ on: | |
| - develop | ||
| - main | ||
| paths: | ||
| - '**.json' | ||
| - '**.ts' | ||
| - '**.js' | ||
| - '**/package.json' | ||
| - 'CHANGELOG.md' | ||
|
Comment on lines
-9
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The path pattern change from paths:
- '**.ts'
- '**.js'
- '**/package.json'
- '**/tsconfig*.json'
- 'CHANGELOG.md' |
||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
|
|
@@ -33,15 +34,15 @@ jobs: | |
| node-version: 24 | ||
|
|
||
| - name: Install Node.js dependencies | ||
| working-directory: frontend | ||
| run: | | ||
| cd frontend | ||
| npm ci | ||
|
|
||
| - name: Run linters | ||
| uses: reviewdog/action-eslint@v1 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| reporter: github-pr-review | ||
| workdir: frontend | ||
| eslint_flags: "--format rdjson --ext .js,.jsx,.ts,.tsx ./" | ||
| fail_level: error | ||
| workdir: frontend | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import { defineConfig, globalIgnores } from "eslint/config"; | ||
| import path from "node:path"; | ||
| import { fileURLToPath } from "node:url"; | ||
| import js from "@eslint/js"; | ||
| import { FlatCompat } from "@eslint/eslintrc"; | ||
|
|
||
| const __filename = fileURLToPath(import.meta.url); | ||
| const __dirname = path.dirname(__filename); | ||
| const compat = new FlatCompat({ | ||
| baseDirectory: __dirname, | ||
| recommendedConfig: js.configs.recommended, | ||
| allConfig: js.configs.all | ||
| }); | ||
|
|
||
| export default defineConfig([globalIgnores(["projects/**/*"]), { | ||
| files: ["**/*.ts"], | ||
|
|
||
| extends: compat.extends( | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/recommended", | ||
| "plugin:@angular-eslint/recommended", | ||
| "plugin:@angular-eslint/template/process-inline-templates", | ||
| ), | ||
|
|
||
| rules: { | ||
| "@angular-eslint/directive-selector": ["error", { | ||
| type: "attribute", | ||
| prefix: "app", | ||
| style: "camelCase", | ||
| }], | ||
|
|
||
| "@angular-eslint/component-selector": ["error", { | ||
| type: "element", | ||
| prefix: "app", | ||
| style: "kebab-case", | ||
| }], | ||
|
|
||
| semi: 2, | ||
| }, | ||
| }, { | ||
| files: ["**/*.html"], | ||
|
|
||
| extends: compat.extends( | ||
| "plugin:@angular-eslint/template/recommended", | ||
| "plugin:@angular-eslint/template/accessibility", | ||
| ), | ||
|
|
||
| rules: {}, | ||
| }]); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding more comprehensive path filters to improve workflow efficiency. The current patterns might trigger on unrelated changes.