Skip to content

Commit

Permalink
Merge pull request #1 from Dannyj1/sonarcloud
Browse files Browse the repository at this point in the history
SonarCloud GitHub Action
  • Loading branch information
Dannyj1 authored Feb 23, 2024
2 parents 6495ebc + 5b597be commit b1264a8
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: SonarCloud
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu' # Alternative distribution options are available
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonar --info
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Mistral-java-client is built against version 0.0.1 of the [Mistral AI API](https
- [List Available Models](https://docs.mistral.ai/api/#operation/listModels)
- "Create Embeddings" to be implemented later

# Requirements
- Java 17 or higher
- A Mistral AI API Key (see the [Mistral documentation](https://docs.mistral.ai/#api-access) for more details on API access)

# Installation

## Gradle
Expand Down
11 changes: 10 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'java'
id 'maven-publish'
id "org.sonarqube" version "4.4.1.3373"
}

group = 'nl.dannyj'
Expand All @@ -27,7 +28,7 @@ dependencies {
}

java {
sourceCompatibility = '11'
sourceCompatibility = '17'
}

publishing {
Expand All @@ -40,4 +41,12 @@ publishing {

test {
useJUnitPlatform()
}

sonar {
properties {
property "sonar.projectKey", "Dannyj1_mistral-java-client"
property "sonar.organization", "danny1"
property "sonar.host.url", "https://sonarcloud.io"
}
}
Empty file modified gradlew
100644 → 100755
Empty file.

0 comments on commit b1264a8

Please sign in to comment.