Repository navigation
98 lines (92 loc) · 3.29 KB
/
Copy pathworkflow.yml
File metadata and controls
98 lines (92 loc) · 3.29 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: PR pipeline
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- name: Set up JDK
uses: ./.github/actions/setup-jdk
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@v5
continue-on-error: true
with:
directory: .
maven-args: "-DmergeClassifiers=true"
format:
needs: build
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- name: Set up JDK
uses: ./.github/actions/setup-jdk
- name: Check formatting
# -nsu безопасен: SNAPSHOT-зависимостей нет.
# Полные координаты вместо префикса spotless: резолв префикса требует metadata из central и падает без кэша.
run: mvn -B -nsu com.diffplug.spotless:spotless-maven-plugin:3.10.3:check --file pom.xml
lint:
needs: build
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- name: Set up JDK
uses: ./.github/actions/setup-jdk
- name: Restore checkstyle cache
uses: actions/cache@v5
with:
# Путь совпадает с cacheFile в pom.xml.
path: target/checkstyle-cachefile
key: checkstyle-${{ hashFiles('checkstyle.xml', 'pom.xml') }}
restore-keys: checkstyle-
- name: Check lint
# -nsu безопасен: SNAPSHOT-зависимостей нет.
# Полные координаты вместо префикса checkstyle: резолв префикса требует metadata из central и падает без кэша.
run: mvn -B -nsu org.apache.maven.plugins:maven-checkstyle-plugin:3.6.0:check --file pom.xml
junit:
needs: build
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- name: Set up JDK
uses: ./.github/actions/setup-jdk
- name: Run tests
run: mvn -B test --file pom.xml
- name: Generate Allure HTML report
# Версия совпадает с allure-maven.version в pom.xml.
# Результат задания определяют тесты: генерация не маскирует их статус
# и не роняет задание при отсутствии результатов.
if: always()
continue-on-error: true
run: mvn -B io.qameta.allure:allure-maven:2.17.0:report --file pom.xml
- name: Upload Allure raw results
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: allure-results
path: target/allure-results
retention-days: 21
if-no-files-found: warn
- name: Upload Allure HTML report
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: allure-report
path: target/allure-report
retention-days: 21
if-no-files-found: warn