[DOCS] Adding documentation and base structure of the repo #1
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
| name: ci | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| jobs: | |
| test-and-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install tooling | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pylint isort black pytest pytest-cov pytest-asyncio | |
| - name: Install lib | |
| run: pip install -e lib | |
| - name: Install apps | |
| run: | | |
| for d in apps/*; do | |
| pip install -e "$d/src" | |
| done | |
| - name: Lint | |
| run: | | |
| python -m isort --check-only lib apps | |
| python -m black --check lib apps | |
| python -m pylint lib/src apps/*/src | |
| - name: Tests with coverage | |
| env: | |
| PYTHONPATH: "${{ github.workspace }}/lib/src" | |
| run: | | |
| pytest lib/tests apps/**/tests --maxfail=1 --cov=. --cov-report=term-missing --cov-fail-under=75 | |
| build-and-push: | |
| needs: test-and-lint | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| env: | |
| REGISTRY: ghcr.io/${{ github.repository_owner }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push images | |
| run: | | |
| for d in apps/*; do | |
| image_name=$(basename "$d") | |
| docker build -t "$REGISTRY/$image_name:latest" -f "$d/src/Dockerfile" "$d" | |
| docker push "$REGISTRY/$image_name:latest" | |
| done |