# Making changes? https://github.com/nektos/act may help you test locally

name: Build And Test

on: [push, pull_request]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
        java: [
                11, # LTS
                15 # Latest
        ]
    steps:
      - name: Check out
        uses: actions/checkout@v2
      - name: Setup JDK ${{ matrix.java }}
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: Cache Gradle packages
        uses: actions/cache@v1
        with:
          path: ~/.gradle/caches
          key: ${{ runner.os }}-${{matrix.java}}-gradle-${{ hashFiles('**/*.gradle') }}
          restore-keys: ${{ runner.os }}-${{matrix.java}}-gradle
      - name: Build with Gradle
        run: ./gradlew build
      - name: Archive test results
        uses: actions/upload-artifact@v2
        with:
          name: test-results
          path: |
            build/test-results/test/
            */build/test-results/test/
            platform/*/build/test-results/test


# Making changes? https://github.com/nektos/act may help you test locally

name: Build And Test

on: [push, pull_request]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
        java: [
                11, # LTS
                15 # Latest
        ]
    steps:
      - name: Check out
        uses: actions/checkout@v2
      - name: Setup JDK ${{ matrix.java }}
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: Cache Gradle packages
        uses: actions/cache@v1
        with:
          path: ~/.gradle/caches
          key: ${{ runner.os }}-${{matrix.java}}-gradle-${{ hashFiles('**/*.gradle') }}
          restore-keys: ${{ runner.os }}-${{matrix.java}}-gradle
      - name: Build with Gradle
        run: ./gradlew build
      - name: Archive test results
        uses: actions/upload-artifact@v2
        with:
          name: test-results
          path: |
            build/test-results/test/
            */build/test-results/test/
            platform/*/build/test-results/test
      - name: Archive distributable plugins
        uses: actions/upload-artifact@v2
        if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload one set of artifacts
        with:
          name: PermissionsEx (all platforms)
          path: build/libs/

Archive artifacts from actions runs
build: Archive artifacts from actions runs
