forked from nnstreamer/nnstreamer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Action] Add composite action for git push
To reduce duplicated code, use composite action for git push. Signed-off-by: Gichan Jang <[email protected]>
- Loading branch information
1 parent
91f5eb4
commit 64c6fd4
Showing
4 changed files
with
85 additions
and
58 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: 'Push to github.io' | ||
description: 'Update the github action result to nnstreamer.github.io' | ||
inputs: | ||
source: | ||
description: 'source path of the file or directory to be copied' | ||
required: true | ||
dest: | ||
description: 'destination directory in nnstreamer.github.io repository' | ||
required: true | ||
message: | ||
description: 'commit message' | ||
required: false | ||
default: 'Update the result from nnstreamer github action.' | ||
taos_account: | ||
required: true | ||
taos_account_token: | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: update the result | ||
run: | | ||
git clone https://${{ inputs.taos_account }}:${{ inputs.taos_account_token }}@github.com/nnstreamer/nnstreamer.github.io.git | ||
pushd nnstreamer.github.io | ||
mkdir -p ${{ inputs.dest }} | ||
cp -r ${{ inputs.source }} ${{ inputs.dest }} | ||
git config user.email "[email protected]" | ||
git config user.name "nnsuite" | ||
git add * | ||
git commit -s -m "${{ inputs.message }}" | ||
git push origin main -f | ||
popd | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,40 +31,37 @@ jobs: | |
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | ||
- name: Update github.io | ||
run: | | ||
git clone https://${{ secrets.TAOS_ACCOUNT }}:${{ secrets.TAOS_ACCOUNT_TOKEN }}@github.com/nnstreamer/nnstreamer.github.io.git | ||
cp -r Documentation/NNStreamer-doc/html/* nnstreamer.github.io/ | ||
pushd nnstreamer.github.io | ||
git config user.email "[email protected]" | ||
git config user.name "nnsuite" | ||
git add * | ||
git commit -s -m "${{ steps.get-date.outputs.date }} : Update nnstreamer.github.io" | ||
git push origin main -f | ||
popd | ||
uses: ./.github/actions/gitpush | ||
with: | ||
source: ${{ github.workspace }}/Documentation/NNStreamer-doc/html/* | ||
dest: ./ | ||
message: "${{ steps.get-date.outputs.date }} : Update nnstreamer.github.io." | ||
taos_account: ${{ secrets.TAOS_ACCOUNT }} | ||
taos_account_token: ${{ secrets.TAOS_ACCOUNT_TOKEN }} | ||
|
||
generate_doxybook: | ||
# reference: https://github.com/nnstreamer/TAOS-CI/tree/main/ci/doxybook | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install packages for doxygen | ||
run: sudo apt-get install doxygen graphviz texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra | ||
- name: Generate doxygen | ||
run: | | ||
doxygen .github/workflows/static.check.scripts/Doxyfile.prj | ||
pushd latex | ||
make -j`nproc` | ||
mv refman.pdf nnstreamer-book.pdf | ||
popd | ||
- name: get date | ||
id: get-date | ||
run: | | ||
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | ||
- 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 --region ap-northeast-2 latex/nnstreamer-book.pdf s3://nnstreamer-release/nnstreamer/${{ steps.get-date.outputs.date }}/doc/nnstreamer-book.pdf | ||
aws s3 cp --region ap-northeast-2 latex/nnstreamer-book.pdf s3://nnstreamer-release/nnstreamer/latest/doc/nnstreamer-book.pdf | ||
# generate_doxybook: | ||
# # reference: https://github.com/nnstreamer/TAOS-CI/tree/main/ci/doxybook | ||
# runs-on: ubuntu-22.04 | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Install packages for doxygen | ||
# run: sudo apt-get install doxygen graphviz texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra | ||
# - name: Generate doxygen | ||
# run: | | ||
# doxygen .github/workflows/static.check.scripts/Doxyfile.prj | ||
# pushd latex | ||
# make -j`nproc` | ||
# mv refman.pdf nnstreamer-book.pdf | ||
# popd | ||
# - name: get date | ||
# id: get-date | ||
# run: | | ||
# echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | ||
# - 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 --region ap-northeast-2 latex/nnstreamer-book.pdf s3://nnstreamer-release/nnstreamer/${{ steps.get-date.outputs.date }}/doc/nnstreamer-book.pdf | ||
# aws s3 cp --region ap-northeast-2 latex/nnstreamer-book.pdf s3://nnstreamer-release/nnstreamer/latest/doc/nnstreamer-book.pdf |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,18 +86,14 @@ jobs: | |
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: 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 | ||
|
@@ -124,12 +120,12 @@ jobs: | |
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 | ||
git clone https://${{ secrets.TAOS_ACCOUNT }}:${{ secrets.TAOS_ACCOUNT_TOKEN }}@github.com/nnstreamer/nnstreamer.github.io.git | ||
pushd nnstreamer.github.io | ||
cp -r ~/testresult/*.svg testresult | ||
git config user.email "[email protected]" | ||
git config user.name "nnsuite" | ||
git add * | ||
git commit -s -m "Update unit test result badge." | ||
git push origin main -f | ||
popd | ||
- 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 }} |
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