Skip to content

Commit

Permalink
[Action] Fix for failure case
Browse files Browse the repository at this point in the history
Even if the step failed, the `continue-on-error` was used to continue the next step.
But `continue-on-error` marks success even if the step fails.
So, let's use `always()` for subsquent steps.

Signed-off-by: Gichan Jang <[email protected]>
  • Loading branch information
gichan-jang committed Nov 15, 2024
1 parent 1dbbfcb commit 01f7707
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/update_gbs_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,19 @@ jobs:
- name: build and tests on GBS
id: gbs-build
continue-on-error: true
run: gbs build ${{ matrix.gbs_build_option }} --define "_skip_debug_rpm 1" -A ${{ matrix.gbs_build_arch }}

- name: report GBS build and test result
id: gbs-result
run: echo "${{ matrix.gbs_build_arch }}=${{ steps.gbs-build.outcome }}" >> $GITHUB_OUTPUT

- name: save gbs cache
uses: actions/cache/save@v4
if: always() && github.ref == 'refs/heads/main'
with:
path: ~/GBS-ROOT/local/cache
key: gbs-cache-${{ matrix.gbs_build_arch }}-${{ steps.get-date.outputs.date }}

- name: report GBS build and test result
id: gbs-result
run: echo "${{ matrix.gbs_build_arch }}=${{ steps.gbs-build.outcome }}" >> $GITHUB_OUTPUT

- name: Release daily build result to release.nnstreamer.com
if: steps.gbs-build.outcome == 'success'
uses: ./.github/actions/s3_upload
Expand All @@ -78,7 +77,7 @@ jobs:
uses: ./.github/actions/s3_upload
with:
source: ~/GBS-ROOT/local/repos/tizen/${{ matrix.gbs_build_arch }}/logs/*/*/log.txt
dest: logs/tizen_gbs_${{ matrix.gbs_build_arch }}_log.txt
dest: logs/nnstreamer_tizen_gbs_${{ matrix.gbs_build_arch }}_log.txt
s3_id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
s3_key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}

Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/update_pbuilder_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,10 @@ jobs:
- name: run pdebuild
id: pdebuild
continue-on-error: true
run: |
mkdir -p ~/daily_build/ubuntu
pdebuild --logfile ~/daily_build/pdebuild_log.txt --buildresult ~/daily_build/ubuntu --architecture ${{ matrix.arch }} -- --distribution ${{ matrix.distroname }}
- name: generate badge
run: |
pip install pybadges setuptools
if [ '${{ steps.pdebuild.outcome }}' == 'success' ]; then
python3 -m pybadges --left-text=test --right-text=success --right-color=green > ~/daily_build/pdebuild_result.svg
else
python3 -m pybadges --left-text=test --right-text=failure --right-color=red > ~/daily_build/pdebuild_result.svg
fi
- name: save pbuilder cache
uses: actions/cache/save@v4
if: always() && github.ref == 'refs/heads/main'
Expand All @@ -83,6 +73,15 @@ jobs:
/var/cache/pbuilder/base.tgz
key: pbuilder-cache-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('**/debian/control') }}-${{ steps.get-date.outputs.date }}

- name: generate badge
run: |
pip install pybadges setuptools
if [ '${{ steps.pdebuild.outcome }}' == 'success' ]; then
python3 -m pybadges --left-text=test --right-text=success --right-color=green > ~/daily_build/pdebuild_result.svg
else
python3 -m pybadges --left-text=test --right-text=failure --right-color=red > ~/daily_build/pdebuild_result.svg
fi
- name: Release daily build result to release.nnstreamer.com
if: steps.pdebuild.outcome == 'success'
uses: ./.github/actions/s3_upload
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/yocto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
key: yocto-cache-yocto-5.0.3

- name: acquire some disk space
if: steps.rebuild.outputs.rebuild == '1'
if: false # Enable this step when you need to make new cache.
run: |
df -h
sudo apt-get update --fix-missing \
Expand All @@ -64,7 +64,6 @@ jobs:
- name: build
if: steps.rebuild.outputs.rebuild == '1'
id: yocto-build
continue-on-error: true
run: |
echo "::group::apt-get install"
sudo apt-get update
Expand All @@ -76,7 +75,14 @@ jobs:
echo "::group::Prepare poky and meta-neural-network"
git clone git://git.yoctoproject.org/poky -b yocto-5.0.3 && cd poky
git clone https://github.com/nnstreamer/meta-neural-network -b scarthgap
WORKDIR="${{ github.workspace }}"
echo 'SRC_URI = "git://${{ github.workspace }}/;protocol=file;usehead=1;nobranch=1"' >> meta-neural-network/recipes-nnstreamer/nnstreamer/nnstreamer_2.4.2.bbappend
echo 'S = "${WORKDIR}/git"' >> meta-neural-network/recipes-nnstreamer/nnstreamer/nnstreamer_2.4.2.bbappend
cat meta-neural-network/recipes-nnstreamer/nnstreamer/nnstreamer_2.4.2.bbappend
echo 'SRC_URI = "git://${{ github.workspace }}/;protocol=file;usehead=1;nobranch=1"' >> meta-neural-network/recipes-nnstreamer/nnstreamer/nnstreamer_%.bbappend
echo 'S = "${WORKDIR}/git"' >> meta-neural-network/recipes-nnstreamer/nnstreamer/nnstreamer_%.bbappend
cat meta-neural-network/recipes-nnstreamer/nnstreamer/nnstreamer_%.bbappend
ls -al meta-neural-network/recipes-nnstreamer/nnstreamer/
source oe-init-build-env
bitbake-layers add-layer ../meta-neural-network
echo "::endgroup::"
Expand Down

0 comments on commit 01f7707

Please sign in to comment.