|
@@ -15,11 +15,6 @@ jobs:
|
|
|
strategy:
|
|
strategy:
|
|
|
matrix:
|
|
matrix:
|
|
|
python-version: ['3.8', '3.9', '3.10', '3.11']
|
|
python-version: ['3.8', '3.9', '3.10', '3.11']
|
|
|
-
|
|
|
|
|
- permissions:
|
|
|
|
|
- contents: write
|
|
|
|
|
- checks: write
|
|
|
|
|
- pull-requests: write
|
|
|
|
|
|
|
|
|
|
steps:
|
|
steps:
|
|
|
- name: Checkout
|
|
- name: Checkout
|
|
@@ -67,45 +62,6 @@ jobs:
|
|
|
- name: Run python unit tests
|
|
- name: Run python unit tests
|
|
|
run: |
|
|
run: |
|
|
|
./build/env/bin/pytest
|
|
./build/env/bin/pytest
|
|
|
-
|
|
|
|
|
- - name: Upload pytest and code coverage reports
|
|
|
|
|
- if: matrix.python-version == '3.11'
|
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
|
- with:
|
|
|
|
|
- name: hue-test-reports
|
|
|
|
|
- path: ./reports
|
|
|
|
|
-
|
|
|
|
|
- - name: Add pytest and code coverage PR comment
|
|
|
|
|
- if: matrix.python-version == '3.11'
|
|
|
|
|
- uses: MishaKav/pytest-coverage-comment@v1
|
|
|
|
|
- with:
|
|
|
|
|
- pytest-xml-coverage-path: ./reports/code-cov/coverage.xml
|
|
|
|
|
- junitxml-path: ./reports/pytest/test_report.xml
|
|
|
|
|
- junitxml-title: Pytest Report
|
|
|
|
|
- title: Backend Code Coverage Report
|
|
|
|
|
- badge-title: Backend Codecov
|
|
|
|
|
- report-only-changed-files: true
|
|
|
|
|
- xml-skip-covered: true
|
|
|
|
|
- remove-link-from-badge: true
|
|
|
|
|
- default-branch: master
|
|
|
|
|
-
|
|
|
|
|
- - name: Check and comment if no unit test files modified
|
|
|
|
|
- if: matrix.python-version == '3.11'
|
|
|
|
|
- run: |
|
|
|
|
|
- git fetch origin master
|
|
|
|
|
- changed_files=$(git diff --name-only origin/master)
|
|
|
|
|
-
|
|
|
|
|
- if echo "$changed_files" | grep -qE '(^test|_test\.py|^tests|_tests\.py|.test)'; then
|
|
|
|
|
- echo "✅ Unit test files were modified."
|
|
|
|
|
- else
|
|
|
|
|
- echo "⚠️ No unit test files modified."
|
|
|
|
|
-
|
|
|
|
|
- curl -X POST \
|
|
|
|
|
- -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
|
|
|
|
- -H "Accept: application/vnd.github.v3+json" \
|
|
|
|
|
- -d '{"body":"⚠️ No unit test files modified. Please ensure that changes are properly tested. ⚠️"}' \
|
|
|
|
|
- "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
|
|
|
|
|
- fi
|
|
|
|
|
|
|
|
|
|
- name: Run python lints
|
|
- name: Run python lints
|
|
|
run: |
|
|
run: |
|
|
@@ -126,3 +82,10 @@ jobs:
|
|
|
./tools/ci/check_for_website_dead_links.sh docs/docs-site
|
|
./tools/ci/check_for_website_dead_links.sh docs/docs-site
|
|
|
# ./tools/ci/check_for_website_dead_links.sh docs/gethue
|
|
# ./tools/ci/check_for_website_dead_links.sh docs/gethue
|
|
|
|
|
|
|
|
|
|
+ - name: Upload reports
|
|
|
|
|
+ if: matrix.python-version == '3.11'
|
|
|
|
|
+ uses: actions/upload-artifact@v4
|
|
|
|
|
+ with:
|
|
|
|
|
+ name: hue-reports
|
|
|
|
|
+ path: ./reports
|
|
|
|
|
+
|