go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.27k stars 5.51k forks source link

CI Task Display Error #25574

Open ExplodingDragon opened 1 year ago

ExplodingDragon commented 1 year ago

Description

When the second task (Package Build) is executed, it shows immediate completion, but in fact the task is not finished.

图片

.gitea/workflows/develop.yaml

name: Package Night Build
on: [ push ]

jobs:
  dev-rocky:
    strategy:
      matrix:
        release: [ "rocky" ]
        version: [ "el9" ]
        arch: [ "amd64","arm64" ]
    runs-on: rocky-${{matrix.arch}}
    steps:
      - name: Check out repository code
        uses: actions/checkout@v3
      - name: Package Build
        uses: actions/package-builder@main
        with:
          release: ${{matrix.release}}
          version: ${{matrix.version}}
          arch: ${{matrix.arch}}
      - name: Upload Package
        run: |
            echo curl path/to/release  

act_runner_version: 0.2.0

action source : https://git.d7z.net/actions/package-builder

Gitea Version

1.20.0-rc2

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

rockylinux 9 - systemd

Database

SQLite

wolfogre commented 1 year ago

I cannot reproduce it, does it always happen or just sometimes? Is there any strange log on the act runner?

ExplodingDragon commented 1 year ago

The logs look fine and the task compiles and passes, but there is a problem with the page presentation.

The situation is that the step completes immediately, but is actually still executing, and the log is updated when I expand the current step.

This problem occurs if I use custom Actions.

EDIT: At this point I am using the latest version of the main branch (c76b221cca)

UPDATE: If the current task is finished, it appears normal.

action.yml

name: 'Package Builder'
description: "一个简易的软件包编译项目, 使用 bash-toolbox 来完成编译任务"
inputs:
  release:
    description: '指定发行版名称,可选 (centos,rocky,arch,debian,ubuntu)'
    required: true
  version:
    description: '指定发行版版本, 根据之前定义的发行版名称来确定,如果无效则返回错误'
    required: true
  arch:
    description: '指定发行版架构,可选 (amd64,arm64,x390s),如果对应发行版无此架构系统则返回错误'
    required: true
  profile:
    description: '指定使用的配置文件'
    required: false
    default: ''
runs:
  using: composite
  steps:
    - id: check
      name: '检查输入参数'
      run: "bash -e ${{ github.action_path }}/src/check.sh '${{inputs.release}}' '${{inputs.version}}'  '${{inputs.arch}}'"
      shell: bash
    - name: "编译项目"
      run: "bash -e ${{ github.action_path }}/src/build.sh '${{inputs.profile}}'"
      shell: bash
wolfogre commented 1 year ago

Sorry, I understand the right way to reproduce it now. The point is that I should use the custom action.

But TBH, it's not easy for me. The custom action need a runner with podman, and it will use your custom container image to build your repo code. I don't have them, so you need to provide more details about this, maybe the runner logs, a screen recording, or the output when you exec bash -e ${{ github.action_path }}/src/build.sh '${{inputs.profile}}' manually.

If it is not convenient for you to provide these here, please join our QQ group (328432459) and @ me. (Or Discord, but I think you are Chinese.)

ExplodingDragon commented 1 year ago

I rebuilt the configuration:

name: 'Package Builder'
description: "一个简易的软件包编译项目, 使用 bash-toolbox 来完成编译任务"
inputs:
  release:
    description: '指定发行版名称,可选 (centos,rocky,arch,debian,ubuntu)'
    required: true
  version:
    description: '指定发行版版本, 根据之前定义的发行版名称来确定,如果无效则返回错误'
    required: true
  arch:
    description: '指定发行版架构,可选 (amd64,arm64,x390s),如果对应发行版无此架构系统则返回错误'
    required: true
  profile:
    description: '指定使用的配置文件'
    required: false
    default: ''
runs:
  using: composite
  steps:
    - id: check
      name: '检查输入参数'
      run: |
        echo '${{inputs.release}}' '${{inputs.version}}'  '${{inputs.arch}}'
        echo 模拟检测
        for (( i = 0; i < 20; i++ )); do
            echo "testing $i ..."
            sleep 1
        done        
      shell: bash
    - name: "编译项目"
      run: |
        echo ' '${{inputs.profile}}''
        for (( i = 0; i < 100; i++ )); do
            echo "build $i ..."
            sleep 1
        done        
      shell: bash

I suspect the problem is with composite action, during task execution, the check task is displayed normally, but the problem recurs when the execution reaches 编译项目.

EDIT: My running container is Podman.

Instructions for use: https://git.d7z.net/packages/gitea-runner (rootless 模式) Related software packages:: https://repos.d7z.net/yum/stable/el9/Packages/gitea-runner-0.2.0-4.el9.x86_64.rpm

wxiaoguang commented 1 year ago

The only difference is that '检查输入参数' has an ID while "编译项目" doesn't have ID?

ExplodingDragon commented 1 year ago

The only difference is that '检查输入参数' has an ID while "编译项目" doesn't have ID?

The id field does not affect the question.

I've tested it.

yp05327 commented 1 month ago

IIRC, matrix is not completely supported.

yp05327 commented 1 month ago

I think this is same to #31397 Reason: https://github.com/go-gitea/gitea/issues/31397#issuecomment-2185592962