Skip to content

Commit

Permalink
Add CI workflows for testing and syncing branches, and update Docker …
Browse files Browse the repository at this point in the history
…image tagging
  • Loading branch information
remsky committed Jan 11, 2025
1 parent 926ea8c commit 22c52fd
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 8 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 8 additions & 8 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/sync-develop.yml
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
- 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']
});
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 22c52fd

Please sign in to comment.