diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml new file mode 100644 index 000000000..826758b6c --- /dev/null +++ b/.github/workflows/build-pr.yml @@ -0,0 +1,48 @@ +name: Build PR + +on: [ pull_request ] + +jobs: + build_pr: + if: github.repository_owner == 'IntellectualSites' + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + - name: Clean Build + run: ./gradlew clean build + - name: Upload test results + if: always() + uses: actions/upload-artifact@v3 + with: + name: Test Results ${{ matrix.os }} + path: Core/build/test-results/test/*.xml + + publish-test-results: + name: "Publish Tests Results" + needs: build_pr + runs-on: ubuntu-latest + permissions: + checks: write + if: always() + steps: + - name: Download Artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + junit_files: Core/build/test-results/test/*.xml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bee920ea9..d7d6fa81c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,15 +1,18 @@ name: build -on: [ pull_request, push ] +on: + push: + branches: + - v6 jobs: build: - if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} + if: github.repository_owner == 'IntellectualSites' runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v3 - - name: Validate Gradle Wrapper" + - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v1 - name: Setup Java uses: actions/setup-java@v3 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 42526cb92..625a76a13 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,8 +1,6 @@ name: "CodeQL" on: - push: - branches: [ v6 ] pull_request: # The branches below must be a subset of the branches above branches: [ v6 ] diff --git a/settings.gradle.kts b/settings.gradle.kts index c35882d55..9bd83f01f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,17 @@ +plugins { + id("com.gradle.enterprise") version("3.9") +} + +gradleEnterprise { + if (System.getenv("CI") != null) { + buildScan { + publishAlways() + termsOfServiceUrl = "https://gradle.com/terms-of-service" + termsOfServiceAgree = "yes" + } + } +} + rootProject.name = "PlotSquared" include("Core", "Bukkit")