Skip to content

Commit a8209c1

Browse files
committed
Polish repository quality and test coverage
1 parent 550bc52 commit a8209c1

339 files changed

Lines changed: 7029 additions & 3491 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.editorconfig‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.java]
10+
indent_style = space
11+
indent_size = 4
12+
max_line_length = 120
13+
14+
[*.md]
15+
indent_size = 2
16+
max_line_length = 120
17+
18+
[*.yml]
19+
indent_size = 2
20+
indent_style = space
21+
22+
[*.yaml]
23+
indent_size = 2
24+
indent_style = space

‎.github/CODEOWNERS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @krotname
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: Report unexpected behavior in a challenge solution or CI pipeline
4+
title: "[bug] "
5+
labels: ["bug"]
6+
assignees: ["krotname"]
7+
---
8+
9+
### Что сломалось
10+
11+
Кратко опишите проблему и ожидаемое поведение.
12+
13+
### Как повторить
14+
15+
1. Действия
16+
2. Входные данные
17+
3. Результат
18+
4. Ожидаемый результат
19+
20+
### Дополнительно
21+
22+
- Версия JDK:
23+
- Путь/команда:
24+
- Логи (если есть):
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: New kata, test strategy, or repository quality improvement
4+
title: "[feat] "
5+
labels: ["enhancement"]
6+
assignees: ["krotname"]
7+
---
8+
9+
### Цель
10+
11+
Что нужно добавить и почему.
12+
13+
### Объем работ
14+
15+
- [ ] Новые решения
16+
- [ ] Новые тесты
17+
- [ ] Обновление документации
18+
- [ ] Обновление CI/качественных проверок
19+
20+
### Критерии принятия
21+
22+
- Какие тесты обязательны
23+
- Что нужно считать ожидаемым результатом

‎.github/dependabot.yml‎

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
1-
# To get started with Dependabot version updates, you'll need to specify which
2-
# package ecosystems to update and where the package manifests are located.
3-
# Please see the documentation for all configuration options:
4-
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5-
61
version: 2
72
updates:
8-
- package-ecosystem: "" # See documentation for possible values
9-
directory: "/" # Location of package manifests
3+
- package-ecosystem: maven
4+
directory: "/"
105
schedule:
11-
interval: "weekly"
12-
6+
interval: weekly
7+
target-branch: main
8+
open-pull-requests-limit: 10
9+
- package-ecosystem: maven
10+
directory: "/"
11+
schedule:
12+
interval: weekly
13+
target-branch: master
14+
open-pull-requests-limit: 10
15+
- package-ecosystem: github-actions
16+
directory: "/"
17+
schedule:
18+
interval: weekly
19+
target-branch: main
20+
open-pull-requests-limit: 10
21+
- package-ecosystem: github-actions
22+
directory: "/"
23+
schedule:
24+
interval: weekly
25+
target-branch: master
26+
open-pull-requests-limit: 10

‎.github/pull_request_template.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Summary
2+
3+
- What changed
4+
- Why it changed
5+
- What risk was reduced/improved
6+
7+
## Checks
8+
9+
- [ ] `mvn -B verify` run
10+
- [ ] Tests added or updated for behavior changes
11+
- [ ] Test categories considered (`unit`, `property`, `integration`)
12+
- [ ] CI changes verified
13+
- [ ] Docs updated (README/CHANGELOG when scope changes)
14+
15+
## Quality notes
16+
17+
- Evidence for coverage/report changes:
18+
- Related issue / task:
Lines changed: 23 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
12-
name: "CodeQL"
1+
name: CodeQL
132

143
on:
154
push:
16-
branches: [ "main" ]
5+
branches: [ "main", "master" ]
176
pull_request:
18-
# The branches below must be a subset of the branches above
19-
branches: [ "main" ]
7+
branches: [ "main", "master" ]
208
schedule:
21-
- cron: '36 20 * * 5'
9+
- cron: "36 20 * * 5"
2210

2311
jobs:
2412
analyze:
@@ -28,52 +16,26 @@ jobs:
2816
actions: read
2917
contents: read
3018
security-events: write
31-
3219
strategy:
3320
fail-fast: false
3421
matrix:
35-
language: [ 'java' ]
36-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38-
22+
language: [ java ]
3923
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v4
42-
43-
- uses: actions/setup-java@v4
44-
with:
45-
java-version: 17
46-
distribution: temurin
47-
48-
# Initializes the CodeQL tools for scanning.
49-
- name: Initialize CodeQL
50-
uses: github/codeql-action/init@v4
51-
with:
52-
languages: ${{ matrix.language }}
53-
# If you wish to specify custom queries, you can do so here or in a config file.
54-
# By default, queries listed here will override any specified in a config file.
55-
# Prefix the list here with "+" to use these queries and those in the config file.
56-
57-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
58-
# queries: security-extended,security-and-quality
59-
60-
61-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
62-
# If this step fails, then you should remove it and run the build manually (see below)
63-
- name: Autobuild
64-
uses: github/codeql-action/autobuild@v4
65-
66-
# ℹ️ Command-line programs to run using the OS shell.
67-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
68-
69-
# If the Autobuild fails above, remove it and uncomment the following three lines.
70-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
71-
72-
# - run: |
73-
# echo "Run, Build Application using script"
74-
# ./location_of_script_within_repo/buildscript.sh
75-
76-
- name: Perform CodeQL Analysis
77-
uses: github/codeql-action/analyze@v4
78-
with:
79-
category: "/language:${{matrix.language}}"
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
- name: Setup Java
27+
uses: actions/setup-java@v4
28+
with:
29+
distribution: temurin
30+
java-version: 21
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@v4
33+
with:
34+
languages: ${{ matrix.language }}
35+
queries: security-and-quality
36+
- name: Build for CodeQL
37+
run: mvn -B verify --file pom.xml
38+
- name: Perform CodeQL Analysis
39+
uses: github/codeql-action/analyze@v4
40+
with:
41+
category: "/language:${{ matrix.language }}"

‎.github/workflows/maven.yml‎

Lines changed: 69 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,80 @@
1-
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
8-
9-
name: Java CI with Maven
1+
name: CI
102

113
on:
124
push:
13-
branches: [ "main" ]
5+
branches: [ "main", "master" ]
146
pull_request:
15-
branches: [ "main" ]
7+
branches: [ "main", "master" ]
168

179
jobs:
18-
build:
10+
category-tests:
11+
name: Test (${{ matrix.category }})
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- category: smoke
20+
groups: smoke
21+
- category: integration
22+
groups: integration
23+
- category: property
24+
groups: property
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
- name: Set up JDK
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: temurin
32+
java-version: 21
33+
cache: maven
34+
- name: Run categorized tests
35+
run: mvn -B test --file pom.xml -Dgroups='${{ matrix.groups }}'
1936

37+
verify:
38+
name: Maven Verify (JDK ${{ matrix.java }})
2039
runs-on: ubuntu-latest
40+
permissions:
41+
contents: read
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
java: [ '17', '21' ]
2146

2247
steps:
23-
- uses: actions/checkout@v4
24-
- name: Set up JDK 17
25-
uses: actions/setup-java@v3
26-
with:
27-
java-version: '17'
28-
distribution: 'temurin'
29-
cache: maven
30-
- name: Build with Maven
31-
run: mvn -B package --file pom.xml
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
- name: Set up JDK
51+
uses: actions/setup-java@v4
52+
with:
53+
distribution: temurin
54+
java-version: ${{ matrix.java }}
55+
cache: maven
56+
- name: Build and test
57+
run: mvn -B verify --file pom.xml
58+
59+
- name: Upload Surefire reports
60+
if: matrix.java == '21'
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: surefire-reports-${{ matrix.java }}
64+
path: target/surefire-reports
65+
66+
- name: Upload JaCoCo report
67+
if: matrix.java == '21'
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: jacoco-report-${{ matrix.java }}
71+
path: target/site/jacoco
72+
if-no-files-found: warn
3273

33-
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
34-
- name: Update dependency graph
35-
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
74+
- name: Upload coverage to Codecov
75+
if: matrix.java == '21'
76+
uses: codecov/codecov-action@v5
77+
with:
78+
files: target/site/jacoco/jacoco.xml
79+
fail_ci_if_error: false
80+
verbose: true

‎.github/workflows/quality.yml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Quality Gates
2+
3+
on:
4+
push:
5+
branches: [ "main", "master" ]
6+
pull_request:
7+
branches: [ "main", "master" ]
8+
9+
jobs:
10+
static-analysis:
11+
name: Static analysis (no tests)
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Set up JDK
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: temurin
22+
java-version: 21
23+
cache: maven
24+
- name: Run static quality plugins
25+
run: mvn -B -DskipTests checkstyle:check pmd:check spotbugs:check
26+
- name: Upload checkstyle report
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: checkstyle-report
30+
path: target/checkstyle-result.xml
31+
if-no-files-found: ignore
32+
- name: Upload pmd report
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: pmd-report
36+
path: target/pmd.xml
37+
if-no-files-found: ignore
38+
- name: Upload spotbugs report
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: spotbugs-report
42+
path: target/spotbugsXml.xml
43+
if-no-files-found: ignore

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ target
33
.idea/
44
*.class
55
*.iml
6+
.jqwik-database

0 commit comments

Comments
 (0)