From 7582be7bc3c7c101187a8849b70146da30accdec Mon Sep 17 00:00:00 2001 From: Simon <9295182+grimsi@users.noreply.github.com> Date: Wed, 12 Oct 2022 18:39:13 +0200 Subject: [PATCH] Add CI pipeline Fixes #34 --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++++++ sonar-project.properties | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 sonar-project.properties diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2f63c29 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: Gameyfin CI Pipeline + +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + name: Build, Test & Scan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '18' + distribution: 'temurin' + cache: 'maven' + - name: Maven build + run: mvn --batch-mode --update-snapshots package + - name: SonarQube scan + uses: kitabisa/sonarqube-action@v1.2.0 + with: + host: ${{ secrets.SONARQUBE_HOST }} + login: ${{ secrets.SONARQUBE_TOKEN }} + projectKey: ${{ secrets.SONARQUBE_PROJECTKEY }} + - name: Upload build artifact + uses: actions/upload-artifact@v3 + with: + name: backend + path: backend/target/gameyfin-*.jar diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..efe7579 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,2 @@ +# Point SONAR to the compiled Java classes +sonar.java.binaries=./backend/target