From c86490ad34eff646785da0db77108d7f2bb810bc Mon Sep 17 00:00:00 2001 From: hudeng Date: Fri, 5 Jan 2024 22:50:30 +0800 Subject: [PATCH 1/3] chore(CI): Use github commit status sync integrate workflow --- .github/workflows/02-build-obs.yml | 80 +++++++++++++++++++++++------- 1 file changed, 62 insertions(+), 18 deletions(-) diff --git a/.github/workflows/02-build-obs.yml b/.github/workflows/02-build-obs.yml index 2682de13b..2471311c0 100644 --- a/.github/workflows/02-build-obs.yml +++ b/.github/workflows/02-build-obs.yml @@ -47,6 +47,7 @@ jobs: outputs: pkgname: ${{ steps.pkgname.outputs.pkgname }} tagsha: ${{ steps.tagsha.outputs.tagsha }} + targeturl: ${{ steps.build.outputs.targeturl }} steps: - name: Print Environment run: export @@ -117,6 +118,7 @@ jobs: echo "tagsha=$TAGSHA" >> $GITHUB_OUTPUT - name: Trigger build + id: build run: | set -x mkdir -p ~/.config/osc @@ -126,15 +128,19 @@ jobs: curl -o meta.xml https://raw.githubusercontent.com/deepin-community/Repository-Integration/master/.github/workflows/obs-pkg-meta.tpl sed -i "s#PKGNAME#${pkgname}#g" meta.xml + targeturl="https://build.deepin.com/project/show/deepin:CI:TestingIntegration:${TOPIC}" if [ "$COMPONENT" = "main" ]; then sed -i "s#Testing:COMPONENT#CI:TestingIntegration:${TOPIC}#g" meta.xml curl -X PUT -u golf66:$OSCPASS -H "Content-type: text/xml" -d @meta.xml "https://build.deepin.com/source/deepin:CI:TestingIntegration:${TOPIC}/$pkgname/_meta" osc co deepin:CI:TestingIntegration:${TOPIC}/${pkgname} && cd $_ + targeturl="https://build.deepin.com/package/live_build_log/deepin:CI:TestingIntegration:${TOPIC}/$pkgname/testing/" else sed -i "s#Testing:COMPONENT#CI:TestingIntegration:${TOPIC}:${COMPONENT}#g" meta.xml curl -X PUT -u golf66:$OSCPASS -H "Content-type: text/xml" -d @meta.xml "https://build.deepin.com/source/deepin:CI:TestingIntegration:${TOPIC}:${COMPONENT}/$pkgname/_meta" osc co deepin:CI:TestingIntegration:${TOPIC}:${COMPONENT}/${pkgname} && cd $_ + targeturl="https://build.deepin.com/package/live_build_log/deepin:CI:TestingIntegration:${TOPIC}:${COMPONENT}/$pkgname/testing/" fi + echo "targeturl=$targeturl" >> $GITHUB_OUTPUT needbuild=true if [ -f _branch_request ];then @@ -161,32 +167,70 @@ jobs: env: ARCH: ${{ matrix.arch }} steps: - - name: Install osc - run: | - sudo apt-get update && sudo apt install -y osc + - name: Set commit status as pending + uses: myrotvorets/set-commit-status-action@master + with: + token: ${{ github.token }} + status: pending + context: "${{ needs.build.outputs.pkgname }} ${{ matrix.arch }} testing repository building" + targetUrl: "${{ needs.build.outputs.targeturl }}${{ matrix.arch }}" + sha: ${{ github.event.pull_request.head.sha }} + + - name: Wait for build to succeed + uses: fountainhead/action-wait-for-check@v1.1.0 + id: wait-for-build + with: + token: ${{ github.token }} + checkName: "${{ needs.build.outputs.pkgname }} ${{ matrix.arch }} testing repository building" + ref: ${{ github.event.pull_request.head.sha || github.sha }} + timeoutSeconds: 3600 #1h,超时后可以/retest 重试 - - name: build log tracker + - name: Do something with a build time out + if: steps.wait-for-build.outputs.conclusion == 'timed_out' + id: wait_time_out run: | set -x + sudo apt-get update && sudo apt install -y osc mkdir -p ~/.config/osc echo "${{ secrets.OSCRC }}" > ~/.config/osc/oscrc pkgname="${{ needs.build.outputs.pkgname }}" if [ "$COMPONENT" = "main" ]; then osc co deepin:CI:TestingIntegration:${TOPIC}/${pkgname} && cd $_ - if [ -z $(osc buildinfo testing ${ARCH} |grep "excluded") ]; then - osc buildlog testing ${ARCH} - if [ "$(osc api -X GET /build/deepin:CI:TestingIntegration:${TOPIC}/testing/${ARCH}/${pkgname}/_status |grep 'succeeded')" = "" -a "$(osc api -X GET /build/deepin:CI:TestingIntegration:${TOPIC}/testing/${ARCH}/${pkgname}/_status |grep 'finished')" = "" ];\ - then echo "${ARCH} build failed" && -1; else echo "${ARCH} build succeeded"; fi - else - echo "${ARCH} build excluded" - fi else osc co deepin:CI:TestingIntegration:${TOPIC}:${COMPONENT}/${pkgname} && cd $_ - if [ -z $(osc buildinfo testing ${ARCH} |grep "excluded") ]; then - osc buildlog testing ${ARCH} - if [ "$(osc api -X GET /build/deepin:CI:TestingIntegration:${TOPIC}:${COMPONENT}/testing/${ARCH}/${pkgname}/_status |grep 'succeeded')" = "" -a "$(osc api -X GET /build/deepin:CI:TestingIntegration:${TOPIC}:${COMPONENT}/testing/${ARCH}/${pkgname}/_status |grep 'finished')" = "" ];\ - then echo "${ARCH} build failed" && -1; else echo "${ARCH} build succeeded"; fi - else - echo "${ARCH} build excluded" - fi fi + + timeouturl="${{ needs.build.outputs.targeturl }}${{ matrix.arch }}" + description="wait build complete timeout" + status="pending" + buildresult=$(osc results -a ${ARCH} -r testing |awk '{print $3}') + if [ "$buildresult" = "succeeded" ];then + status="success" + description="" + elif [ "$buildresult" = "excluded" ]; then + status="success" + description="build excluded" + timeouturl="" + elif [ "$buildresult" = "failed" ]; then + status="failure" + description="" + fi + echo "timeouturl=$timeouturl" >> $GITHUB_OUTPUT + echo "description=$description" >> $GITHUB_OUTPUT + echo "status=$status" >> $GITHUB_OUTPUT + + - name: Update status build status as timeout + if: steps.wait-for-build.outputs.conclusion == 'timed_out' + uses: myrotvorets/set-commit-status-action@master + with: + token: ${{ github.token }} + status: ${{ steps.wait_time_out.outputs.status }} + context: "${{ needs.build.outputs.pkgname }} ${{ matrix.arch }} testing repository building" + targetUrl: ${{ steps.wait_time_out.outputs.timeouturl }} + sha: ${{ github.event.pull_request.head.sha }} + description: ${{ steps.wait_time_out.outputs.description }} + + - name: report build error at action + if: steps.wait_time_out.outputs.status != 'success' || steps.wait-for-build.outputs.conclusion == 'failure' + run: | + exit -1 From 4fd3b03da49b213f77e53053ee72a1138497be8e Mon Sep 17 00:00:00 2001 From: BLumia Date: Tue, 9 Jan 2024 06:51:57 +0000 Subject: [PATCH 2/3] chore: Update integration.yml Signed-off-by: github-actions --- integration.yml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/integration.yml b/integration.yml index fa8bbc8d1..85b4d20fd 100644 --- a/integration.yml +++ b/integration.yml @@ -1,15 +1,8 @@ -# Required -message: | - Integrated for V23-Beta3 -# Not required, now default is V23-Beta3 +message: >- + fix: reset scrollview/swipeview position when hide by + BLumia@linuxdeepin/dde-launchpad milestone: V23-Beta3 -# Required -repos: - # Required - - repo: linuxdeepin/examplerepo - # Not required - tag: 5.11.22 - # Not required, but need one of tag and tagsha info - # When use tag info, integration workflow will check repository tag and build tag version - # When use tagsha info, interation workflow will build tagsha version, It doesn't matter whether the tag exists. - tagsha: "********************************" +repos: + - repo: linuxdeepin/dde-launchpad + tagsha: 19c2b40e8f153b8e6fda1e285f689f143871282a +timestamp: 1704783112201 From 47c41c0406c5c944933718c3e672e079cf8defcf Mon Sep 17 00:00:00 2001 From: hudeng Date: Fri, 5 Jan 2024 22:50:30 +0800 Subject: [PATCH 3/3] chore(CI): Use github commit status sync integrate workflow --- .github/workflows/02-build-obs.yml | 81 +++++++++++++++++++++++------- 1 file changed, 63 insertions(+), 18 deletions(-) diff --git a/.github/workflows/02-build-obs.yml b/.github/workflows/02-build-obs.yml index 2682de13b..bacd142cf 100644 --- a/.github/workflows/02-build-obs.yml +++ b/.github/workflows/02-build-obs.yml @@ -47,6 +47,7 @@ jobs: outputs: pkgname: ${{ steps.pkgname.outputs.pkgname }} tagsha: ${{ steps.tagsha.outputs.tagsha }} + targeturl: ${{ steps.build.outputs.targeturl }} steps: - name: Print Environment run: export @@ -117,6 +118,7 @@ jobs: echo "tagsha=$TAGSHA" >> $GITHUB_OUTPUT - name: Trigger build + id: build run: | set -x mkdir -p ~/.config/osc @@ -126,15 +128,19 @@ jobs: curl -o meta.xml https://raw.githubusercontent.com/deepin-community/Repository-Integration/master/.github/workflows/obs-pkg-meta.tpl sed -i "s#PKGNAME#${pkgname}#g" meta.xml + targeturl="https://build.deepin.com/project/show/deepin:CI:TestingIntegration:${TOPIC}" if [ "$COMPONENT" = "main" ]; then sed -i "s#Testing:COMPONENT#CI:TestingIntegration:${TOPIC}#g" meta.xml curl -X PUT -u golf66:$OSCPASS -H "Content-type: text/xml" -d @meta.xml "https://build.deepin.com/source/deepin:CI:TestingIntegration:${TOPIC}/$pkgname/_meta" osc co deepin:CI:TestingIntegration:${TOPIC}/${pkgname} && cd $_ + targeturl="https://build.deepin.com/package/live_build_log/deepin:CI:TestingIntegration:${TOPIC}/$pkgname/testing/" else sed -i "s#Testing:COMPONENT#CI:TestingIntegration:${TOPIC}:${COMPONENT}#g" meta.xml curl -X PUT -u golf66:$OSCPASS -H "Content-type: text/xml" -d @meta.xml "https://build.deepin.com/source/deepin:CI:TestingIntegration:${TOPIC}:${COMPONENT}/$pkgname/_meta" osc co deepin:CI:TestingIntegration:${TOPIC}:${COMPONENT}/${pkgname} && cd $_ + targeturl="https://build.deepin.com/package/live_build_log/deepin:CI:TestingIntegration:${TOPIC}:${COMPONENT}/$pkgname/testing/" fi + echo "targeturl=$targeturl" >> $GITHUB_OUTPUT needbuild=true if [ -f _branch_request ];then @@ -161,32 +167,71 @@ jobs: env: ARCH: ${{ matrix.arch }} steps: - - name: Install osc - run: | - sudo apt-get update && sudo apt install -y osc + - name: Set commit status as pending + uses: myrotvorets/set-commit-status-action@master + with: + token: ${{ github.token }} + status: pending + context: "${{ needs.build.outputs.pkgname }}_${{ matrix.arch }}_testing_repository_building" + targetUrl: "${{ needs.build.outputs.targeturl }}${{ matrix.arch }}" + sha: ${{ github.event.pull_request.head.sha }} + + - name: Wait for build to succeed + uses: fountainhead/action-wait-for-check@v1.1.0 + id: wait-for-build + with: + token: ${{ github.token }} + checkName: "${{ needs.build.outputs.pkgname }}_${{ matrix.arch }}_testing_repository_building" + ref: ${{ github.event.pull_request.head.sha || github.sha }} + timeoutSeconds: 3600 # 1h,超时后可以/retest 重试 + intervalSeconds: 60 - - name: build log tracker + - name: Do something with a build time out + if: steps.wait-for-build.outputs.conclusion == 'timed_out' + id: wait_time_out run: | set -x + sudo apt-get update && sudo apt install -y osc mkdir -p ~/.config/osc echo "${{ secrets.OSCRC }}" > ~/.config/osc/oscrc pkgname="${{ needs.build.outputs.pkgname }}" if [ "$COMPONENT" = "main" ]; then osc co deepin:CI:TestingIntegration:${TOPIC}/${pkgname} && cd $_ - if [ -z $(osc buildinfo testing ${ARCH} |grep "excluded") ]; then - osc buildlog testing ${ARCH} - if [ "$(osc api -X GET /build/deepin:CI:TestingIntegration:${TOPIC}/testing/${ARCH}/${pkgname}/_status |grep 'succeeded')" = "" -a "$(osc api -X GET /build/deepin:CI:TestingIntegration:${TOPIC}/testing/${ARCH}/${pkgname}/_status |grep 'finished')" = "" ];\ - then echo "${ARCH} build failed" && -1; else echo "${ARCH} build succeeded"; fi - else - echo "${ARCH} build excluded" - fi else osc co deepin:CI:TestingIntegration:${TOPIC}:${COMPONENT}/${pkgname} && cd $_ - if [ -z $(osc buildinfo testing ${ARCH} |grep "excluded") ]; then - osc buildlog testing ${ARCH} - if [ "$(osc api -X GET /build/deepin:CI:TestingIntegration:${TOPIC}:${COMPONENT}/testing/${ARCH}/${pkgname}/_status |grep 'succeeded')" = "" -a "$(osc api -X GET /build/deepin:CI:TestingIntegration:${TOPIC}:${COMPONENT}/testing/${ARCH}/${pkgname}/_status |grep 'finished')" = "" ];\ - then echo "${ARCH} build failed" && -1; else echo "${ARCH} build succeeded"; fi - else - echo "${ARCH} build excluded" - fi fi + + timeouturl="${{ needs.build.outputs.targeturl }}${{ matrix.arch }}" + description="wait build complete timeout" + status="pending" + buildresult=$(osc results -a ${ARCH} -r testing |awk '{print $3}') + if [ "$buildresult" = "succeeded" ];then + status="success" + description="" + elif [ "$buildresult" = "excluded" ]; then + status="success" + description="build excluded" + timeouturl="" + elif [ "$buildresult" = "failed" ]; then + status="failure" + description="" + fi + echo "timeouturl=$timeouturl" >> $GITHUB_OUTPUT + echo "description=$description" >> $GITHUB_OUTPUT + echo "status=$status" >> $GITHUB_OUTPUT + + - name: Update status build status as timeout + if: steps.wait-for-build.outputs.conclusion == 'timed_out' + uses: myrotvorets/set-commit-status-action@master + with: + token: ${{ github.token }} + status: ${{ steps.wait_time_out.outputs.status }} + context: "${{ needs.build.outputs.pkgname }}_${{ matrix.arch }}_testing_repository_building" + targetUrl: ${{ steps.wait_time_out.outputs.timeouturl }} + sha: ${{ github.event.pull_request.head.sha }} + description: ${{ steps.wait_time_out.outputs.description }} + + - name: report build error at action + if: steps.wait_time_out.outputs.status != 'success' || steps.wait-for-build.outputs.conclusion == 'failure' + run: | + exit -1