Skip to content

Feature: AI chat

Feature: AI chat #452

Workflow file for this run

name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
delete-comments:
name: Delete bot comment(s)
runs-on: ubuntu-latest
steps:
- uses: izhangzhihao/delete-comment@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
delete_user_name: github-actions[bot]
issue_number: ${{ github.event.number }}
branch-naming-rules:
name: Check branch name
runs-on: ubuntu-latest
steps:
- uses: deepakputhraya/action-branch-name@master
with:
regex: '^(feature|bugfix|improvement|library|prerelease|release|hotfix)\/[a-z0-9_.-]+$'
allowed_prefixes: 'feature,bugfix,improvement,library,prerelease,release,hotfix'
ignore: main
min_length: 5
max_length: 50
checkstyle:
name: Code style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11 for x64
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
architecture: x64
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute checkstyle
run: ./gradlew checkstyleMain
tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21 for x64
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
architecture: x64
- name: Install Pandoc
run: sudo apt-get update && sudo apt-get install -y pandoc
- name: Generate certificate
run: |
keytool \
-genkeypair -v \
-alias mykey \
-dname "CN=Test, OU=Test, O=Test, L=Test, S=Test, C=Test" \
-keystore src/main/resources/keystore.jks \
-storepass password \
-keypass password \
-keyalg RSA \
-keysize 2048 \
-validity 3650
- name: Build application
run: docker build -t leto-modelizer-api .
- name: Run application
run: docker compose -f docker-compose-e2e.yml up -d
env:
GITHUB_CLIENT_ID: test
GITHUB_CLIENT_SECRET: test
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute unit/e2e tests
run: ./gradlew test
- name: Execute mutation tests
run: ./gradlew pitest
- name: Extract summary from pitest
run: echo "<html><head></head><body><h1>Pit Test Coverage Report</h1><h3>Project Summary</h3>" > pitest.html && perl -0777 -ne 'print "$1\n" if /(<table>.*?<\/table>)/s' build/reports/pitest/index.html >> pitest.html && echo "</body></html>" >> pitest.html
- name: Convert pitest report to markdown
run: pandoc --from html --to markdown_github --no-highlight pitest.html
- name: Post comment
uses: luukkemp/pr-comment@2024.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: pitest.html
- name: Execute sonar scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonar -Dsonar.token=$SONAR_TOKEN -Dsonar.gradle.skipCompile=true
check-dependencies:
name: Check dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11 for x64
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
architecture: x64
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute check dependencies
run: ./gradlew dependencyUpdates
- name: Post comment
uses: luukkemp/pr-comment@2024.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: build/dependencyUpdates/report.txt