-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from luxonis/dev
DataDreamer - v0.2.0
- Loading branch information
Showing
57 changed files
with
5,226 additions
and
1,187 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Manually deploy image to GHCR | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'Branch to deploy' | ||
required: true | ||
default: 'dev' | ||
|
||
env: | ||
GHCR_REGISTRY: ghcr.io | ||
IMAGE_NAME: datadreamer | ||
|
||
jobs: | ||
push-store: | ||
name: Push the image to GHCR | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 'Checkout GitHub Action' | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ inputs.branch }} # Checkout the selected branch | ||
|
||
- name: 'Extract short commit hash' | ||
id: commit_hash | ||
run: echo "short_hash=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
|
||
- name: Docker login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: luxonis-ml | ||
password: ${{ secrets.GHCR_PAT }} | ||
|
||
- name: 'Build and Push Image to GHCR' | ||
run: | | ||
docker build --build-arg GITHUB_TOKEN=${{secrets.GHCR_PAT}} --build-arg BRANCH=${{ inputs.branch }} . \ | ||
--tag ghcr.io/luxonis/datadreamer:${{ steps.commit_hash.outputs.short_hash }} | ||
docker push ghcr.io/luxonis/datadreamer --all-tags |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Docker Build and Publish | ||
name: Deploy latest image to GHCR on release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,23 @@ name: Tests | |
|
||
on: | ||
pull_request: | ||
branches: [ dev, main ] | ||
branches: [ main ] | ||
paths: | ||
- 'datadreamer/**/**.py' | ||
- 'tests/**/**.py' | ||
- 'tests/core_tests/**/**.py' | ||
- .github/workflows/tests.yaml | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run_tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
os: [buildjet-8vcpu-ubuntu-2204, windows-latest, macOS-latest] | ||
version: ['3.10', '3.11'] | ||
exclude: | ||
- os: buildjet-8vcpu-ubuntu-2204 | ||
version: '3.11' | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
|
@@ -31,56 +35,52 @@ jobs: | |
cache: pip | ||
|
||
- name: Install dependencies [Ubuntu] | ||
if: matrix.os == 'ubuntu-latest' | ||
if: matrix.os == 'buildjet-8vcpu-ubuntu-2204' | ||
run: | | ||
sudo apt update | ||
sudo apt install -y pandoc | ||
pip install -e .[dev] | ||
pip install coverage-badge>=1.1.0 pytest-cov>=4.1.0 | ||
- name: Install dependencies [Windows] | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
pip install -e .[dev] | ||
pip install coverage-badge>=1.1.0 pytest-cov>=4.1.0 | ||
- name: Install dependencies [macOS] | ||
if: matrix.os == 'macOS-latest' | ||
run: | | ||
pip install -e .[dev] | ||
pip install coverage-badge>=1.1.0 pytest-cov>=4.1.0 | ||
- name: Run tests with coverage [Ubuntu] | ||
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10' | ||
run: pytest tests --cov=datadreamer --cov-report xml --junit-xml pytest.xml | ||
if: matrix.os == 'buildjet-8vcpu-ubuntu-2204' && matrix.version == '3.10' | ||
run: pytest tests/core_tests --cov=datadreamer --cov-report xml --junit-xml pytest.xml | ||
|
||
- name: Run tests [Windows, macOS] | ||
if: matrix.os != 'ubuntu-latest' || matrix.version != '3.10' | ||
run: pytest tests --junit-xml pytest.xml | ||
if: matrix.os != 'buildjet-8vcpu-ubuntu-2204' | ||
run: pytest tests/core_tests --junit-xml pytest.xml | ||
|
||
- name: Generate coverage badge [Ubuntu] | ||
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10' | ||
if: matrix.os == 'buildjet-8vcpu-ubuntu-2204' && matrix.version == '3.10' | ||
run: coverage-badge -o media/coverage_badge.svg -f | ||
|
||
- name: Generate coverage report [Ubuntu] | ||
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10' | ||
if: matrix.os == 'buildjet-8vcpu-ubuntu-2204' && matrix.version == '3.10' | ||
uses: orgoro/[email protected] | ||
with: | ||
coverageFile: coverage.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Commit coverage badge [Ubuntu] | ||
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10' | ||
if: matrix.os == 'buildjet-8vcpu-ubuntu-2204' && matrix.version == '3.10' | ||
run: | | ||
git config --global user.name 'GitHub Actions' | ||
git config --global user.email '[email protected]' | ||
git diff --quiet media/coverage_badge.svg || { | ||
git add media/coverage_badge.svg | ||
git commit -m "[Automated] Updated coverage badge" | ||
} | ||
- name: Push changes [Ubuntu] | ||
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10' | ||
if: matrix.os == 'buildjet-8vcpu-ubuntu-2204' && matrix.version == '3.10' | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: ${{ github.head_ref }} | ||
|
@@ -117,4 +117,4 @@ jobs: | |
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
with: | ||
files: "artifacts/**/*.xml" | ||
files: "artifacts/**/*.xml" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: Unit tests | ||
|
||
on: | ||
pull_request: | ||
branches: [ dev ] | ||
paths: | ||
- 'datadreamer/**/**.py' | ||
- 'tests/core_tests/unittests/**.py' | ||
- .github/workflows/unit-tests.yaml | ||
|
||
jobs: | ||
run_tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
version: ['3.10', '3.11'] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.version }} | ||
cache: pip | ||
|
||
- name: Install dependencies [Ubuntu] | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt update | ||
sudo apt install -y pandoc | ||
pip install -e .[dev] | ||
pip install coverage-badge>=1.1.0 pytest-cov>=4.1.0 | ||
- name: Install dependencies [Windows] | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
pip install -e .[dev] | ||
pip install coverage-badge>=1.1.0 pytest-cov>=4.1.0 | ||
- name: Install dependencies [macOS] | ||
if: matrix.os == 'macOS-latest' | ||
run: | | ||
pip install -e .[dev] | ||
pip install coverage-badge>=1.1.0 pytest-cov>=4.1.0 | ||
- name: Run tests with coverage [Ubuntu] | ||
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10' | ||
run: pytest tests/core_tests/unittests --cov=datadreamer --cov-report xml --junit-xml pytest.xml | ||
|
||
- name: Run tests [Windows, macOS] | ||
if: matrix.os != 'ubuntu-latest' || matrix.version != '3.10' | ||
run: pytest tests/core_tests/unittests --junit-xml pytest.xml | ||
|
||
- name: Generate coverage badge [Ubuntu] | ||
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10' | ||
run: coverage-badge -o media/coverage_badge.svg -f | ||
|
||
- name: Generate coverage report [Ubuntu] | ||
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10' | ||
uses: orgoro/[email protected] | ||
with: | ||
coverageFile: coverage.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Commit coverage badge [Ubuntu] | ||
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10' | ||
run: | | ||
git config --global user.name 'GitHub Actions' | ||
git config --global user.email '[email protected]' | ||
git diff --quiet media/coverage_badge.svg || { | ||
git add media/coverage_badge.svg | ||
git commit -m "[Automated] Updated coverage badge" | ||
} | ||
- name: Push changes [Ubuntu] | ||
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.10' | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: ${{ github.head_ref }} | ||
|
||
- name: Upload Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Test Results [${{ matrix.os }}] (Python ${{ matrix.version }}) | ||
path: pytest.xml | ||
retention-days: 10 | ||
if-no-files-found: error | ||
|
||
publish-test-results: | ||
name: "Publish Tests Results" | ||
needs: run_tests | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
if: always() | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
|
||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
with: | ||
files: "artifacts/**/*.xml" |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.