diff --git a/.github/workflows/gradle.yaml b/.github/workflows/gradle.yaml new file mode 100644 index 000000000..471da3426 --- /dev/null +++ b/.github/workflows/gradle.yaml @@ -0,0 +1,61 @@ +# This workflow will build a Java project with Gradle +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: SlimeVR Server + +on: [push, pull_request] + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: "11" + distribution: "adopt" + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + + - name: Check code formatting + run: ./gradlew spotlessCheck + + - name: Test with Gradle + run: ./gradlew test + + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: "11" + distribution: "adopt" + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + + - name: Build with Gradle + run: ./gradlew shadowJar + + - name: Upload the Server JAR as a Build Artifact + uses: actions/upload-artifact@v3 + with: + # Artifact name + name: "SlimeVR-Server" # optional, default is artifact + # A file, directory or wildcard pattern that describes what to upload + path: build/libs/* diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml deleted file mode 100644 index 78ce3079a..000000000 --- a/.github/workflows/gradle.yml +++ /dev/null @@ -1,57 +0,0 @@ -# This workflow will build a Java project with Gradle -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: SlimeVR Server - -on: [ push, pull_request ] - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2.4.0 - with: - submodules: recursive - - - name: Set up JDK 11 - uses: actions/setup-java@v2.4.0 - with: - java-version: '11' - distribution: 'adopt' - cache: 'gradle' # will restore cache of dependencies and wrappers - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Test with Gradle - run: ./gradlew clean test - - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2.4.0 - with: - submodules: recursive - - - name: Set up JDK 11 - uses: actions/setup-java@v2.4.0 - with: - java-version: '11' - distribution: 'adopt' - cache: 'gradle' # will restore cache of dependencies and wrappers - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Build with Gradle - run: ./gradlew clean shadowJar - - - name: Upload the Server JAR as a Build Artifact - uses: actions/upload-artifact@v2.2.4 - with: - # Artifact name - name: "SlimeVR-Server" # optional, default is artifact - # A file, directory or wildcard pattern that describes what to upload - path: build/libs/* diff --git a/build.gradle b/build.gradle index 6ecbbac64..24a0fdaa4 100644 --- a/build.gradle +++ b/build.gradle @@ -90,19 +90,19 @@ spotless { // define the steps to apply to those files trimTrailingWhitespace() endWithNewline() - indentWithTabs() // or spaces. Takes an integer argument if you don't like 4 + indentWithTabs() } + // format 'yaml', { + // target '*.yml', '*.yaml', + + // trimTrailingWhitespace() + // endWithNewline() + // indentWithSpaces(2) // YAML cannot contain tabs: https://yaml.org/faq.html + // } java { removeUnusedImports() - // Use eclipse JDT + // Use eclipse JDT formatter eclipse().configFile("spotless.xml") - - // apply a specific flavor of google-java-format - // googleJavaFormat('1.8').aosp().reflowLongStrings() - // make sure every file has the following copyright header. - // optionally, Spotless can set copyright years by digging - // through git history (see "license" section below) - // licenseHeader '/* (C)$YEAR */' } }