[enh.]添加Gitea软件包自托管, 避免本地代码每次都需要编译. #118
This file contains hidden or 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
| # This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created | |
| # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle | |
| name: Build | |
| on: | |
| push: | |
| pull_request: | |
| release: | |
| types: [created] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Microsoft OpenJDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'microsoft' | |
| cache: gradle | |
| - name: Validate Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v3 | |
| - name: Build with Gradle | |
| run: ./gradlew --no-daemon --parallel build -x test | |
| # 编译成功. 上报代码覆盖率结果 | |
| - name: Generate Codecov Report | |
| # if: ${{ failure() }} | |
| if: ${{ success() }} | |
| run: ./gradlew codeCoverageReport | |
| # https://github.com/codecov/codecov-action | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: unittests | |
| name: codecov-struct-util | |
| fail_ci_if_error: true | |
| verbose: true |