Repository navigation
63 lines (52 loc) · 1.58 KB
/
Copy pathbuild.yml
File metadata and controls
63 lines (52 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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@v7
with:
# com.palantir.git-version определяет version по тегам,
# при shallow clone теги недоступны и версия получается неверной
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '21'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
- 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@v7
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@v7
with:
name: TrackStudio-war
path: build/libs/TrackStudio.war
if-no-files-found: error
retention-days: 14