fix: run backend as root for docker socket access #21
This file contains hidden or 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
| # CI Pipeline - Test and Lint | |
| name: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| # Backend tests and linting | |
| backend: | |
| name: Backend CI | |
| runs-on: self-hosted | |
| defaults: | |
| run: | |
| working-directory: backend | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| cache-dependency-path: backend/requirements.txt | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pytest pytest-asyncio black==24.1.0 ruff==0.1.14 | |
| - name: Run Black (format check) | |
| run: black --check . | |
| - name: Run Ruff (linting) | |
| run: ruff check . --ignore E402,E741 | |
| continue-on-error: true | |
| - name: Run Tests | |
| run: pytest tests/ -v --tb=short | |
| env: | |
| TESTING: "true" | |
| continue-on-error: true | |
| # Frontend build | |
| frontend: | |
| name: Frontend CI | |
| runs-on: self-hosted | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run ESLint | |
| run: npm run lint -- --max-warnings 100 | |
| continue-on-error: true | |
| - name: Build | |
| run: npm run build | |
| # Worker linting | |
| worker: | |
| name: Worker CI | |
| runs-on: self-hosted | |
| defaults: | |
| run: | |
| working-directory: worker | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| cache-dependency-path: worker/requirements.txt | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install black==24.1.0 ruff==0.1.14 | |
| - name: Run Black (format check) | |
| run: black --check . | |
| - name: Run Ruff (linting) | |
| run: ruff check . --ignore E741 | |
| continue-on-error: true |