forked from nnstreamer/nnstreamer
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (114 loc) · 4.79 KB
/
update_gbs_cache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
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:
outputs:
x86_64: ${{ steps.gbs-result.outputs.x86_64 }}
armv7l: ${{ steps.gbs-result.outputs.armv7l }}
aarch64: ${{ steps.gbs-result.outputs.aarch64 }}
strategy:
fail-fast: false
matrix:
include:
- gbs_build_arch: "x86_64"
gbs_build_option: "--define \"unit_test 1\" --define \"testcoverage 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
id: gbs-build
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() && 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
with:
source: ~/GBS-ROOT/local/repos/tizen/${{ matrix.gbs_build_arch }}/RPMS/
dest: RPMS/
s3_id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
s3_key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
s3_option: --recursive
- name: Release daily build log to release.nnstreamer.com
uses: ./.github/actions/s3_upload
with:
source: ~/GBS-ROOT/local/repos/tizen/${{ matrix.gbs_build_arch }}/logs/*/*/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 }}
- if: matrix.gbs_build_arch == 'x86_64' && steps.gbs-build.outcome == 'success'
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' && steps.gbs-build.outcome == 'success'
name: update test coverage result to github.io
uses: ./.github/actions/gitpush
with:
source: ~/testresult/usr/share/nnstreamer/unittest/result/*
dest: testresult
message: "${{ steps.get-date.outputs.date }} : Update test coverage result."
taos_account: ${{ secrets.TAOS_ACCOUNT }}
taos_account_token: ${{ secrets.TAOS_ACCOUNT_TOKEN }}
- 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
print_result:
runs-on: ubuntu-22.04
needs: [cache_gbs_build]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v1
- name: print-result
run: |
mkdir -p ~/testresult
pip install pybadges setuptools
echo '${{ toJSON( needs.cache_gbs_build.outputs) }}' > gbs_build_result.json
python3 .github/workflows/gen_gbs_result_badge.py gbs_build_result.json ~/testresult
- name: update result badge to github.io
uses: ./.github/actions/gitpush
with:
source: ~/testresult/*.svg
dest: testresult
message: "Update unit test result badge."
taos_account: ${{ secrets.TAOS_ACCOUNT }}
taos_account_token: ${{ secrets.TAOS_ACCOUNT_TOKEN }}