diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a2cbe1a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: + push: + branches: [ "develop", "master" ] + pull_request: + branches: [ "develop", "master" ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11"] + fail-fast: false + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Set up pip cache + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install PyTorch CPU + run: | + python -m pip install --upgrade pip + pip install torch --index-url https://download.pytorch.org/whl/cpu + + - name: Install dependencies + run: | + pip install ruff pytest-cov + pip install -r requirements.txt + pip install -r requirements-test.txt + + - name: Lint with ruff + run: | + ruff check . + + + - name: Test with pytest + run: | + pytest --asyncio-mode=auto --cov=api --cov-report=term-missing diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index eb97779..c9d860b 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -49,10 +49,10 @@ jobs: flavor: | suffix=-cpu tags: | - type=semver,pattern=v{{version}}-cpu - type=semver,pattern=v{{major}}.{{minor}}-cpu - type=semver,pattern=v{{major}}-cpu - type=raw,value=latest-cpu + type=semver,pattern=v{{version}} + type=semver,pattern=v{{major}}.{{minor}} + type=semver,pattern=v{{major}} + type=raw,value=latest # Build and push GPU version - name: Build and push GPU Docker image @@ -85,10 +85,10 @@ jobs: flavor: | suffix=-ui tags: | - type=semver,pattern=v{{version}}-ui - type=semver,pattern=v{{major}}.{{minor}}-ui - type=semver,pattern=v{{major}}-ui - type=raw,value=latest-ui + type=semver,pattern=v{{version}} + type=semver,pattern=v{{major}}.{{minor}} + type=semver,pattern=v{{major}} + type=raw,value=latest # Build and push UI version - name: Build and push UI Docker image diff --git a/.github/workflows/sync-develop.yml b/.github/workflows/sync-develop.yml new file mode 100644 index 0000000..2e0cfd5 --- /dev/null +++ b/.github/workflows/sync-develop.yml @@ -0,0 +1,55 @@ +name: Sync develop with master + +on: + push: + branches: + - master + +jobs: + sync-develop: + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: develop + + - name: Configure Git + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + + - name: Merge master into develop + run: | + git fetch origin master:master + git merge --no-ff origin/master -m "chore: Merge master into develop branch" + + - name: Push changes + run: | + if ! git push origin develop; then + echo "Failed to push to develop branch" + exit 1 + fi + + - name: Handle Failure + if: failure() + uses: actions/github-script@v7 + with: + script: | + const issueBody = `Automatic merge from master to develop failed. + + Please resolve this manually + + Workflow run: ${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; + + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: '🔄 Automatic master to develop merge failed', + body: issueBody, + labels: ['merge-failed', 'automation'] + }); diff --git a/CHANGELOG.md b/CHANGELOG.md index 6303af1..d67d1e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ Notable changes to this project will be documented in this file. +## [v0.0.5] - 2025-01-10 +### Fixed +- Stabilized issues with images tagging and structures from v0.0.4 +- Added automatic master to develop branch synchronization +- Improved release tagging and structures +- Initial CI/CD setup + ## 2025-01-04 ### Added - ONNX Support: