diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 7d520fe..0c55c55 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -1,19 +1,26 @@ name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 + +name: Java CI + on: [push] jobs: - Explore-Gitea-Actions: - runs-on: node20 + build: + runs-on: ubuntu-22.04 steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - - name: Check out repository code + # 1. 检出代码 + - name: Checkout code uses: http://172.23.112.123:3000/actions/checkout@main - - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ gitea.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file + + # 2. 设置 OpenJDK 17 + - name: Set up JDK 17 + uses: http://172.23.112.123:3000/actions/setup-java.git@main + with: + distribution: 'temurin' # 使用 Eclipse Temurin(OpenJDK 发行版) + java-version: '17' + + # 3. 构建项目(假设使用 Maven) + - name: Build with Maven + run: mvn -h + + \ No newline at end of file