Skip to content

Commit

Permalink
Merge main: Resolve conflicts in workflow and test configuration
Browse files Browse the repository at this point in the history
- Keep PostgreSQL and Alembic setup in workflow
- Add improved caching and artifact handling
- Merge test configurations while preserving markers
- Keep updated frontend README with pnpm instructions
  • Loading branch information
devin-ai-integration[bot] committed Nov 10, 2024
2 parents b428a50 + 23f929b commit cacbb83
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 7 deletions.
48 changes: 43 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: CI/CD Pipeline

on:
push:
Expand All @@ -24,11 +24,21 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('backend/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
working-directory: ./backend
run: |
Expand All @@ -42,6 +52,17 @@ jobs:
# Add local bin to PATH
export PATH="$HOME/.local/bin:$PATH"
pip list | grep alembic
- name: Setup backend test environment
working-directory: ./backend
run: |
echo "DEV_MODE=true" > .env
echo "DATABASE_URL=postgresql://postgres:postgres@localhost:5432/test_db" >> .env
echo "API_HOST=0.0.0.0" >> .env
echo "API_PORT=8000" >> .env
echo "[email protected]" >> .env
echo "INDEED_PASSWORD=testpass123" >> .env
- name: Verify environment
working-directory: ./backend
env:
Expand Down Expand Up @@ -186,21 +207,32 @@ jobs:
# Run the migration script
python run_migrations.py
- name: Run tests with coverage
working-directory: ./backend
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test_db
run: |
pytest --cov=src tests/ --cov-report=xml
pytest tests/ -v --cov=src --cov-report=xml --junitxml=test-results/results.xml
- name: Run flake8
working-directory: ./backend
run: |
flake8 src tests --max-line-length=100
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: backend-test-results
path: |
backend/coverage.xml
backend/test-results/results.xml
frontend-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
Expand All @@ -215,4 +247,10 @@ jobs:
run: pnpm install
- name: Run tests
working-directory: ./frontend
run: pnpm test
run: CI=true pnpm test
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: frontend-test-results
path: frontend/test-results
1 change: 0 additions & 1 deletion INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
- Python 3.8+
- Node.js 18.0.0+
- PostgreSQL 12+
- Chrome/Chromium browser
- pnpm (for frontend package management)

## Backend Setup
Expand Down
6 changes: 5 additions & 1 deletion backend/pytest.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
[pytest]
addopts = -v --tb=short
pythonpath = .
testpaths = tests
testpaths = tests/
python_files = test_*.py
python_functions = test_*
markers =
timeout: Mark test with timeout value
asyncio: Mark test as async
integration: Mark test as integration test
filterwarnings =
ignore::DeprecationWarning
log_cli = true
log_cli_level = INFO
51 changes: 51 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Prerequisites

- Node.js (version 18.0.0 or higher)
- pnpm (recommended package manager)

## Available Scripts

In the project directory, you can run:

### `pnpm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `pnpm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `pnpm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `pnpm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

0 comments on commit cacbb83

Please sign in to comment.