name: Binary Backward Compatibility

on: [ push, pull_request ]

jobs:
  build:
    env:
      JAVA_VERSION: '11'
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: "Set up JDK ${{ matrix.java_version }}"
        uses: actions/setup-java@v1
        with:
          java-version: ${{env.JAVA_VERSION}}

      - name: bbcTests
        env:
          BC: 1
        run: ./gradlew bbcTests --stacktrace

      - name: Upload windows build code coverage
        uses: codecov/codecov-action@v1
        if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/master') }}
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          flags: bbc
          env_vars: JAVA_VERSION
          # too many timeout errors, let's not fail at the moment
          #fail_ci_if_error: true
