build: 调整tag生成方式 #83
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
| name: Test | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| manual_trigger: | |
| description: 'Manual trigger' | |
| required: false | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '21' | |
| cache: 'gradle' | |
| - name: Run Test with Gradle | |
| run: ./gradlew test jacocoTestReport testCodeCoverageReport --no-daemon | |
| - name: Store reports | |
| if: failure() | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: reports | |
| path: | | |
| **/build/reports/ | |
| **/build/test-results/ | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| directory: build/reports/jacoco/ | |
| files: testCodeCoverageReport.xml |