name: PR Check 8.x series

on:
  push:
    paths:
      - 'optaplanner-8-benchmarks/**'

  pull_request:
    paths:
      - 'optaplanner-8-benchmarks/**'

jobs:
  pr-check:
    runs-on: ubuntu-latest

    steps:
      - name: Check  out Git repository
        uses: actions/checkout@v2

      - name: Set up JDK
        uses: actions/setup-java@v2
        with:
          java-version: 11
          distribution: adopt

      # See https://docs.github.com/en/actions/guides/building-and-testing-java-with-maven#caching-dependencies
      - name: Cache Maven packages
        uses: actions/cache@v2
        with:
          path: ~/.m2
          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
          restore-keys: ${{ runner.os }}-m2

      - name: Maven Build
        run: mvn -B --fail-at-end clean install -f optaplanner-8-benchmarks

      - name: Check runtime
        run: java -jar ./optaplanner-8-benchmarks/optaplanner-perf-benchmark/target/optaplanner-8-benchmarks.jar -jvmArgs '-Xms6144m -Xmx6144m' -v NORMAL -foe false -gc true -wi 1 -i 1 -f 1


name: PR Check 8.x series

on:
  push:
    paths:
      - 'optaplanner-8-benchmarks/**'

  pull_request:
    paths:
      - 'optaplanner-8-benchmarks/**'

jobs:
  pr-check:
    runs-on: ubuntu-latest

    steps:
      - name: Check  out Git repository
        uses: actions/checkout@v2

      - name: Set up JDK
        uses: actions/setup-java@v2
        with:
          java-version: 11
          distribution: adopt

      # See https://docs.github.com/en/actions/guides/building-and-testing-java-with-maven#caching-dependencies
      - name: Cache Maven packages
        uses: actions/cache@v2
        with:
          path: ~/.m2
          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
          restore-keys: ${{ runner.os }}-m2

      - name: Maven Build
        run: mvn -B --fail-at-end clean install -f optaplanner-8-benchmarks

      - name: Check runtime
        working-directory: ./optaplanner-8-benchmarks
        run: java -jar ./optaplanner-perf-benchmark/target/optaplanner-8-benchmarks.jar -jvmArgs '-Xms6144m -Xmx6144m' -v NORMAL -foe false -gc true -wi 1 -i 1 -f 1


Switch working directory before run
Switch working directory before run
