Fix compilation issue by updating package management to pnpm #178
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Backend CI | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r backend/requirements.txt | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
cache: 'pnpm' | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Install frontend dependencies | |
run: | | |
cd frontend | |
pnpm install | |
- name: Run frontend tests | |
run: | | |
cd frontend | |
pnpm test | |
- name: Run backend tests | |
run: | | |
cd backend | |
pytest tests/ --junitxml=test-results/results.xml | |
- name: Ensure test results directory | |
run: mkdir -p backend/test-results/ | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: backend/test-results/results.xml |