Merge pull request #29 from PyDevDeep/dependabot/pip/httpx-0.28.1 #156
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/CD Pipeline | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| jobs: | |
| test-and-scan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install Poetry | |
| run: curl -sSL https://install.python-poetry.org | python3 - | |
| - name: Cache Poetry virtualenv | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pypoetry/virtualenvs | |
| key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-poetry- | |
| - name: Install dependencies | |
| run: poetry install --no-root | |
| - name: Security Scan (Dependencies) | |
| run: poetry run pip install pip-audit && poetry run pip-audit | |
| continue-on-error: true | |
| - name: Check formatting with Ruff | |
| run: poetry run ruff format --check . | |
| - name: Lint with Ruff | |
| run: poetry run ruff check . | |
| - name: Type checking with Pyright | |
| run: poetry run pyright | |
| - name: Run Unit Tests | |
| run: poetry run pytest -m "not remote" | |
| # build-and-push: | |
| # needs: test-and-scan | |
| # runs-on: ubuntu-latest | |
| # if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| # steps: | |
| # - uses: actions/checkout@v7 | |
| # - name: Build Docker image | |
| # run: | | |
| # REPO_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') | |
| # docker build -t ghcr.io/$REPO_OWNER/bubblebrain:${{ github.sha }} . | |
| # # Uncomment to push to registry | |
| # # echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| # # docker push ghcr.io/$REPO_OWNER/bubblebrain:${{ github.sha }} | |
| # | |
| # deploy-vds: | |
| # needs: build-and-push | |
| # runs-on: ubuntu-latest | |
| # if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| # steps: | |
| # - name: Deploy to VDS via SSH | |
| # uses: appleboy/ssh-action@master | |
| # with: | |
| # host: ${{ secrets.VDS_HOST }} | |
| # username: ${{ secrets.VDS_USER }} | |
| # key: ${{ secrets.VDS_SSH_KEY }} | |
| # script: | | |
| # # cd /opt/bubblebrain | |
| # # export APP_VERSION=${{ github.sha }} | |
| # # docker-compose pull | |
| # # docker-compose up -d | |
| # # docker image prune -f | |
| # echo "Deployment step. Uncomment commands and setup secrets to enable." |