diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 3aeb29d6..103d143f 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,64 +1,32 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle - -name: Java CI with Gradle +name: Gradle Build Pipeline on: push: - branches: [ "main" ] + branches: [ "NukkitMot" ] pull_request: - branches: [ "main" ] + branches: [ "NukkitMot" ] permissions: contents: read jobs: - build: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'corretto' + + - name: Check codestyle + uses: gradle/gradle-build-action@v2 + with: + arguments: spotlessCheck - - name: Gradle Build Action - # You may pin to the exact commit or the version. - # uses: gradle/gradle-build-action@87a9a15658c426a54dd469d4fc7dc1a73ca9d4a6 - uses: gradle/gradle-build-action@v2.10.0 - with: - # Gradle version to use. If specified, this Gradle version will be downloaded, added to the PATH and used for invoking Gradle. - gradle-version: # optional - # Path to the Gradle executable. If specified, this executable will be added to the PATH and used for invoking Gradle. - gradle-executable: # optional - # Path to the root directory of the build. Default is the root of the GitHub workspace. - build-root-directory: # optional - # When 'true', all caching is disabled. No entries will be written to or read from the cache. - cache-disabled: false # optional - # When 'true', existing entries will be read from the cache but no entries will be written. - - cache-read-only: false # optional, default is ${{ github.event.repository != null && github.ref_name != github.event.repository.default_branch }} - # When 'true', entries will not be restored from the cache but will be saved at the end of the Job. - - cache-write-only: # optional - # When 'true', a pre-existing Gradle User Home will not prevent the cache from being restored. - cache-overwrite-existing: # optional - # Paths within Gradle User Home to cache. - gradle-home-cache-includes: # optional, default is caches - - # Paths within Gradle User Home to exclude from cache. - gradle-home-cache-excludes: # optional - # When 'true', the action will attempt to remove any stale/unused entries from the Gradle User Home prior to saving to the GitHub Actions cache. - gradle-home-cache-cleanup: # optional - # Gradle command line arguments (supports multi-line input) - arguments: # optional - # When 'false', no Job Summary will be generated for the Job. - generate-job-summary: # optional, default is true - # Specifies if a GitHub dependency snapshot should be generated for each Gradle build, and if so, how. Valid values are 'disabled' (default), 'generate', 'generate-and-submit' and 'download-and-submit'. - dependency-graph: # optional, default is disabled - # Specifies the number of days to retain any artifacts generated by the action. If not set, the default retention settings for the repository will apply. - artifact-retention-days: # optional - # When 'true', the action will not attempt to restore the Gradle User Home entries from other Jobs. - gradle-home-cache-strict-match: # optional - # Used to uniquely identify the current job invocation. Defaults to the matrix values for this job; this should not be overridden by users (INTERNAL). - workflow-job-context: # optional, default is ${{ toJSON(matrix) }} - # The GitHub token used to authenticate when submitting via the Dependency Submission API. - github-token: # optional, default is ${{ github.token }} - + - name: Build + uses: gradle/gradle-build-action@v2 + with: + arguments: assemble