Skip to content

chore(deps): bump ruff from 0.14.10 to 0.14.11 #452

chore(deps): bump ruff from 0.14.10 to 0.14.11

chore(deps): bump ruff from 0.14.10 to 0.14.11 #452

Workflow file for this run

name: CI - Pull Request
on:
pull_request:
branches: [main]
paths:
- src/**
- tests/**
- Dockerfile
- pylintrc
- pytest.ini
- requirements-test.txt
- requirements.txt
- run-ci.sh
workflow_dispatch:
jobs:
cache-requirements-install:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Cache pip dependencies
uses: actions/cache@v4
id: cache-dependencies
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
pip install -r requirements-test.txt
test:
needs: cache-requirements-install
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Restore pip cache dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install -r requirements-test.txt
- name: Test with pytest
run: |
sudo mkdir /config /icloud &&
sudo chown -R $(id -u):$(id -g) /config /icloud &&
ruff check &&
ENV_CONFIG_FILE_PATH=./tests/data/test_config.yaml pytest
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Generate Allure Report
uses: simple-elf/allure-report-action@master
if: always()
with:
allure_results: allure-results
allure_history: allure-history
keep_reports: 100
- name: Upload tests artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: tests-output
path: allure-history
retention-days: 1
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
if: ${{ success() }}
with:
name: coverage-output
path: htmlcov
retention-days: 1
build-and-push-docker:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
pull-requests: write
steps:
- name: Check Out Repo
uses: actions/checkout@v4
- name: Prepare PR tag
id: prep
run: |
PR_NUMBER=$(echo ${{ github.event.number }})
if [ -z "$PR_NUMBER" ]; then
# Fallback for workflow_dispatch or other cases
PR_NUMBER=$(echo "${{ github.ref }}" | sed 's/.*\///')
fi
# Use lowercase repository name for GHCR
REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
TAGS="ghcr.io/${REPO_NAME}:pr-${PR_NUMBER}"
echo "PR Number: $PR_NUMBER"
echo "Repository: $REPO_NAME"
echo "Docker Tags: $TAGS"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "pr_number=${PR_NUMBER}" >> $GITHUB_OUTPUT
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
driver-opts: network=host
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
build-args: |
NEW_INSTALLATION_ENDPOINT=${{ secrets.NEW_INSTALLATION_ENDPOINT }}
NEW_HEARTBEAT_ENDPOINT=${{ secrets.NEW_HEARTBEAT_ENDPOINT }}
APP_VERSION=pr-${{ steps.prep.outputs.pr_number }}
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.prep.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
sbom: false
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Comment PR with Docker image info
uses: actions/github-script@v7
if: github.event_name == 'pull_request'
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `🐳 **Docker Image Built Successfully!**
The Docker image for this PR has been built and pushed to GitHub Container Registry:
**Image Tag:** \`${{ steps.prep.outputs.tags }}\`
**Usage:**
\`\`\`bash
docker pull ${{ steps.prep.outputs.tags }}
docker run --name icloud-pr-test -v \${PWD}/icloud:/icloud -v \${PWD}/config:/config -e ENV_CONFIG_FILE_PATH=/config/config.yaml ${{ steps.prep.outputs.tags }}
\`\`\`
**Build Info:**
- Platforms: linux/arm64, linux/amd64
- Image Digest: ${{ steps.docker_build.outputs.digest }}
- Built from commit: ${{ github.sha }}
`
})