From 0f6255206e22215fcd573f8e4c84df5a616ad39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=9F=E5=AE=81?= Date: Wed, 5 Mar 2025 09:45:26 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20.gitea/ci.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/ci.yaml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .gitea/ci.yaml diff --git a/.gitea/ci.yaml b/.gitea/ci.yaml new file mode 100644 index 0000000..e3f17d7 --- /dev/null +++ b/.gitea/ci.yaml @@ -0,0 +1,43 @@ +name: CI Pipeline +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: 🔍 Check out repository code + uses: actions/checkout@v4 + - name: 🔧 Test Codes and Build an Artifact + run: | + set -e # 任何命令失败都停止执行 + + echo "Building repository code ${{ gitea.repository }}:${{ gitea.ref }}." + make + + # 运行 fork 并检查退出代码 + echo "Running fork..." + ./fork + fork_exit_code=$? + if [ $fork_exit_code -ne 0 ]; then + echo "fork failed with exit code $fork_exit_code" + exit 1 + fi + + # 运行 execlp 并检查退出代码 (如果 execlp 是一个可执行文件) + echo "Running execlp..." + ./execlp + execlp_exit_code=$? + if [ $execlp_exit_code -ne 0 ]; then + echo "execlp failed with exit code $execlp_exit_code" + exit 1 + fi + + echo "All tests passed!" + + make clean \ No newline at end of file