mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-10-31 01:23:44 +01:00 
			
		
		
		
	Separate workflows between PRs and pushes
This commit is contained in:
		
							
								
								
									
										48
									
								
								.github/workflows/build-pr.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								.github/workflows/build-pr.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -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 | ||||||
							
								
								
									
										9
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,15 +1,18 @@ | |||||||
| name: build | name: build | ||||||
|  |  | ||||||
| on: [ pull_request, push ] | on: | ||||||
|  |   push: | ||||||
|  |     branches: | ||||||
|  |       - v6 | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|   build: |   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 |     runs-on: ubuntu-latest | ||||||
|     steps: |     steps: | ||||||
|       - name: Checkout Repository |       - name: Checkout Repository | ||||||
|         uses: actions/checkout@v3 |         uses: actions/checkout@v3 | ||||||
|       - name: Validate Gradle Wrapper" |       - name: Validate Gradle Wrapper | ||||||
|         uses: gradle/wrapper-validation-action@v1 |         uses: gradle/wrapper-validation-action@v1 | ||||||
|       - name: Setup Java |       - name: Setup Java | ||||||
|         uses: actions/setup-java@v3 |         uses: actions/setup-java@v3 | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								.github/workflows/codeql.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/codeql.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,8 +1,6 @@ | |||||||
| name: "CodeQL" | name: "CodeQL" | ||||||
|  |  | ||||||
| on: | on: | ||||||
|   push: |  | ||||||
|     branches: [ v6 ] |  | ||||||
|   pull_request: |   pull_request: | ||||||
|     # The branches below must be a subset of the branches above |     # The branches below must be a subset of the branches above | ||||||
|     branches: [ v6 ] |     branches: [ v6 ] | ||||||
|   | |||||||
| @@ -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" | rootProject.name = "PlotSquared" | ||||||
|  |  | ||||||
| include("Core", "Bukkit") | include("Core", "Bukkit") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Alexander Brandes
					Alexander Brandes