Update GitHub action build script

This commit is contained in:
tastybento 2024-11-08 15:34:34 -08:00
parent 0b6dc8c76a
commit d0a4cd1e28

View File

@ -1,24 +1,23 @@
name: SonarCloud
name: Build
on:
push:
branches:
- develop
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
name: Build
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
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
java-version: '21'
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
@ -36,3 +35,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=BentoBoxWorld_AcidIsland
- run: mvn --batch-mode clean org.jacoco:jacoco-maven-plugin:prepare-agent install
- run: mkdir staging && cp target/*.jar staging
- name: Save artifacts
uses: actions/upload-artifact@v3
with:
name: Package
path: staging