Skip to content

Commit

Permalink
Merge pull request #153 from espressif/fix/warnings_and_log_handlers
Browse files Browse the repository at this point in the history
Fix: warnings and log handlers
  • Loading branch information
hfudev authored Sep 9, 2024
2 parents b498ef3 + a91c599 commit c92ecaa
Show file tree
Hide file tree
Showing 11 changed files with 288 additions and 179 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-build-idf-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
path: dist/idf_build_apps-*.whl

build-apps-on-idf-env:
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'test-old-idf-releases') }}
needs: build-python-packages
strategy:
matrix:
idf-branch: [ release-v5.0, release-v5.1, release-v5.2 ]
idf-branch: [ release-v5.0, release-v5.1, release-v5.2, release-v5.3 ]
runs-on: ubuntu-latest
container:
image: espressif/idf:${{ matrix.idf-branch }}
Expand Down
10 changes: 8 additions & 2 deletions idf_build_apps/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def build_log_path(self) -> str:
return os.path.join(self.build_path, self.build_log_filename)

# use a temp file if build log path is not specified
return os.path.join(self.build_path, f'.temp.build.{hash(self)}.log')
return os.path.join(self.build_path, '.temp.build.log')

@computed_field # type: ignore
@property
Expand Down Expand Up @@ -559,6 +559,8 @@ def build(

self._post_build()

self._finalize()

def _post_build(self) -> None:
"""Post build actions for failed/success builds"""
if self.build_status not in (
Expand Down Expand Up @@ -623,9 +625,13 @@ def _post_build(self) -> None:
for line in lines[-self.LOG_DEBUG_LINES :]:
self._logger.error('%s', line)

def _finalize(self) -> None:
"""
Actions for real success builds
"""
if self.build_status != BuildStatus.SUCCESS:
return

# Actions for real success builds
# remove temp log file
if self._is_build_log_path_temp:
os.unlink(self.build_log_path)
Expand Down
Loading

0 comments on commit c92ecaa

Please sign in to comment.