Skip to content

Фикс сборки тестов #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,5 @@ jobs:
java-version: '17'
distribution: 'temurin'

- name: Build with Maven (+ unit tests only)
run: mvn clean test

- name: Integration tests
run: mvn verify -P integration-tests
env:
GIGACHAT_API_CLIENT_ID: ${{ secrets.GIGACHAT_API_CLIENT_ID }}
GIGACHAT_API_CLIENT_SECRET: ${{ secrets.GIGACHAT_API_CLIENT_SECRET }}
GIGACHAT_API_SCOPE: ${{ secrets.GIGACHAT_API_SCOPE }}
- name: Build with Maven (unit tests only)
run: mvn clean test --no-transfer-progress
32 changes: 32 additions & 0 deletions .github/workflows/maven-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: PR Merged build (with integration tests)

on:
pull_request:
branches:
- main
- release/*
types: [closed]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Build with Maven (unit tests)
run: mvn clean test --no-transfer-progress

- name: Integration tests
run: mvn verify -P integration-tests --no-transfer-progress
env:
GIGACHAT_API_CLIENT_ID: ${{ secrets.GIGACHAT_API_CLIENT_ID }}
GIGACHAT_API_CLIENT_SECRET: ${{ secrets.GIGACHAT_API_CLIENT_SECRET }}
GIGACHAT_API_SCOPE: ${{ secrets.GIGACHAT_API_SCOPE }}
33 changes: 25 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@

<properties>
<java.version>17</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<allure-bom.version>2.26.0</allure-bom.version>
<aspectj.version>1.9.22</aspectj.version>
<allure-bom.version>2.29.1</allure-bom.version>
<aspectj.version>1.9.24</aspectj.version>
<spring-boot.version>3.4.5</spring-boot.version>
<spring-ai.version>1.0.0</spring-ai.version>
<sslcontext-kickstart>8.3.5</sslcontext-kickstart>
<sslcontext-kickstart>8.3.7</sslcontext-kickstart>
<lombok.version>1.18.38</lombok.version>

<maven.deploy.plugin.version>3.1.4</maven.deploy.plugin.version>
</properties>
Expand Down Expand Up @@ -124,10 +124,26 @@
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
<release>${maven.compiler.release}</release>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<version>3.5.3</version>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
<argLine>
Expand Down Expand Up @@ -162,7 +178,7 @@
<plugin>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-maven</artifactId>
<version>2.12.0</version>
<version>2.15.2</version>
<configuration>
<reportVersion>${allure-bom.version}</reportVersion>
<resultsDirectory>${project.build.directory}/allure-results</resultsDirectory>
Expand All @@ -172,7 +188,7 @@
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.43.0</version>
<version>2.44.5</version>
<configuration>
<java>
<palantirJavaFormat/>
Expand Down Expand Up @@ -248,6 +264,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.3</version>
<executions>
<execution>
<goals>
Expand Down
16 changes: 16 additions & 0 deletions spring-ai-gigachat-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,22 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
<release>${java.version}</release>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class GigaChatApiProperties {

private Resource clientCertificate;
private Resource clientKey;

@Builder.Default
private boolean unsafeSsl = false;

public enum GigaChatApiScope {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ public ResponseEntity<ModelsResponse> models() {

private Consumer<HttpHeaders> applyHeaders(@Nullable HttpHeaders headers) {
return httpHeaders -> {
httpHeaders.add(HttpHeaders.USER_AGENT, USER_AGENT_SPRING_AI_GIGACHAT);
if (!CollectionUtils.isEmpty(headers)) {
httpHeaders.addAll(headers);
}
httpHeaders.set(HttpHeaders.USER_AGENT, USER_AGENT_SPRING_AI_GIGACHAT);
};
}
}
Loading