Merge pull request #13 from maximkr/docs/readme-badges #4
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: Build | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| # Новый пуш в ту же ветку отменяет предыдущий незавершённый прогон | |
| concurrency: | |
| group: build-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Gradle build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| # com.palantir.git-version определяет version по тегам, | |
| # при shallow clone теги недоступны и версия получается неверной | |
| fetch-depth: 0 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Print version | |
| run: ./gradlew --no-daemon printVersion | |
| - name: Build (compile + test + war) | |
| run: ./gradlew --no-daemon --stacktrace build | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: | | |
| build/reports/tests/test | |
| build/test-results/test | |
| if-no-files-found: ignore | |
| retention-days: 14 | |
| - name: Upload WAR | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: TrackStudio-war | |
| path: build/libs/TrackStudio.war | |
| if-no-files-found: error | |
| retention-days: 14 |