NNStreamer + NNTrainer gbs build daily test. #212
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
name: NNStreamer + NNTrainer gbs build daily test. | |
on: | |
schedule: | |
# 05:00 AM (KST) Mon-Fri | |
- cron: "00 20 * * 0-4" | |
# Allow manually triggering the workflow | |
workflow_dispatch: | |
jobs: | |
cache_gbs_build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- gbs_build_arch: "x86_64" | |
gbs_build_option: "--define \"unit_test 1\" --define \"testcoverage 1\"" | |
- gbs_build_arch: "i586" | |
gbs_build_option: "--define \"unit_test 1\"" | |
- gbs_build_arch: "armv7l" | |
gbs_build_option: "--define \"unit_test 1\"" | |
- gbs_build_arch: "aarch64" | |
gbs_build_option: "--define \"unit_test 1\"" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v1 | |
- name: prepare deb sources for GBS | |
run: echo "deb [trusted=yes] http://download.tizen.org/tools/latest-release/Ubuntu_22.04/ /" | sudo tee /etc/apt/sources.list.d/tizen.list | |
- name: install GBS | |
run: sudo apt-get update && sudo apt-get install -y gbs | |
- name: configure GBS | |
run: cp .github/workflows/tizen.gbs.conf ~/.gbs.conf | |
- name: get date | |
id: get-date | |
run: | | |
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: build and tests on GBS | |
run: gbs build ${{ matrix.gbs_build_option }} --define "_skip_debug_rpm 1" -A ${{ matrix.gbs_build_arch }} | |
- name: save gbs cache | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: ~/GBS-ROOT/local/cache | |
key: gbs-cache-${{ matrix.gbs_build_arch }}-${{ steps.get-date.outputs.date }} | |
- name: Release daily build result | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }} | |
AWS_EC2_METADATA_DISABLED: true | |
run: | | |
aws s3 cp --recursive --region ap-northeast-2 ~/GBS-ROOT/local/repos/tizen/${{ matrix.gbs_build_arch }}/RPMS/ s3://nnstreamer-release/nnstreamer/${{ steps.get-date.outputs.date }}/RPMS/ | |
aws s3 cp --recursive --region ap-northeast-2 ~/GBS-ROOT/local/repos/tizen/${{ matrix.gbs_build_arch }}/RPMS/ s3://nnstreamer-release/nnstreamer/latest/RPMS/ | |
- if: matrix.gbs_build_arch == 'x86_64' | |
name: extract test coverage result | |
run: | | |
pip install pybadges beautifulsoup4 setuptools | |
mkdir -p ~/testresult/ | |
pushd ~/testresult/ | |
cp ~/GBS-ROOT/local/repos/tizen/x86_64/RPMS/*-coverage*.rpm . | |
rpm2cpio *-coverage*.rpm | cpio -idv | |
popd | |
python3 .github/workflows/gen_coverage_badge.py ~/testresult/usr/share/nnstreamer/unittest/result/index.html ~/testresult/usr/share/nnstreamer/unittest/result/coverage_badge.svg | |
- if: matrix.gbs_build_arch == 'x86_64' | |
name: Update github.io | |
run: | | |
git clone https://${{ secrets.TAOS_ACCOUNT }}:${{ secrets.TAOS_ACCOUNT_TOKEN }}@github.com/nnstreamer/nnstreamer.github.io.git | |
pushd nnstreamer.github.io | |
mkdir -p testresult | |
cp -r ~/testresult/usr/share/nnstreamer/unittest/result/* testresult | |
git config user.email "[email protected]" | |
git config user.name "nnsuite" | |
git add * | |
git commit -s -m "${{ steps.get-date.outputs.date }} : Update unit test result." | |
git push origin main -f | |
popd | |
- name: Get nntrainer | |
uses: actions/checkout@v4 | |
with: | |
repository: nnstreamer/nntrainer | |
path: nntrainer | |
- name: Run nntrainer GBS build | |
run: | | |
pushd nntrainer | |
gbs build --skip-srcrpm -A ${{ matrix.gbs_build_arch }} ${{ matrix.gbs_build_option }} --define "_skip_debug_rpm 1" | |
popd |