# common steps before running actula tests for both
# when a cache of test times is presen and when it is not present

name: pre-test-actions
description: pre-test-actions
runs:
  using: "composite"

  steps:

    - name: set env variables
      uses: ./.github/workflows/composites/env-variables

    - name: setup project jdk-17
      uses: ./.github/workflows/composites/setup-jdk17
      if: env.BASE_BRANCH == 'main'

    - name: setup project jdk-8
      uses: ./.github/workflows/composites/setup-jdk1.8
      if: env.BASE_BRANCH == '2.1.x'

    - name: cache local maven repository
      uses: ./.github/workflows/composites/cache

    - name: build project
      shell: bash
      run: |
        ./mvnw clean install -Dskip.build.image=true -DskipITs -DskipTests -T1C -U -B -q  

    - name: build controllers project
      uses: ./.github/workflows/composites/build-controllers-project

    - name: build integration tests project
      uses: ./.github/workflows/composites/build-integration-tests-project

    - name: download tests
      uses: actions/download-artifact@v3
      with:
        name: tests.txt
        path: /tmp




