diff --git a/.github/actions/runTestsTaggedAs/action.yaml b/.github/actions/runTestsTaggedAs/action.yaml new file mode 100644 index 00000000000..472fe15a080 --- /dev/null +++ b/.github/actions/runTestsTaggedAs/action.yaml @@ -0,0 +1,42 @@ +name: 'Execute tests tagged in a certain way' +description: 'Execute tests suite for tests tagged as specified' +inputs: + tag: + description: Cucumber tag of the tests to run + required: true + needs-docker-images: + description: true if this suite needs docker images, false otherwise + required: false + default: 'true' +#outputs: +runs: + using: "composite" + steps: + - name: Setup java + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 11 + - name: Cache Maven repository + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache + - name: Docker images creation + if: ${{ inputs.needs-docker-images == 'true' }} + run: mvn clean install -pl ${APP_PROJECTS} && mvn clean install -Pdocker --f assembly/pom.xml + shell: bash + - name: Dns look-up containers needed for tests - message-broker + if: ${{ inputs.needs-docker-images == 'true' }} + run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts + shell: bash + - name: Dns look-up containers needed for tests - job-engine + if: ${{ inputs.needs-docker-images == 'true' }} + run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts + shell: bash + - name: Test execution step + run: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="${{ inputs.tag }}" -pl ${TEST_PROJECTS} verify + shell: bash + - name: Code-coverage results + run: bash <(curl -s https://codecov.io/bash) + shell: bash \ No newline at end of file diff --git a/.github/workflows/kapua-ci.yaml b/.github/workflows/kapua-ci.yaml index 8dc0473004c..130e74cfcd7 100755 --- a/.github/workflows/kapua-ci.yaml +++ b/.github/workflows/kapua-ci.yaml @@ -1,28 +1,28 @@ name: Kapua CI on: [ push, pull_request ] # Triggers the workflow on push or pull request events -env: +env: #the last 2 env variables defines respectively the maven projects were cucumber tests resides and maven projects were consumers applications needed for docker images building resides. BUILD_OPTS: "" CONFIG_OVERRIDES: "-Dcommons.db.schema=kapuadb -Dcommons.settings.hotswap=true -Dbroker.host=localhost -Dcrypto.secret.key=kapuaTestsKey!!!" MAVEN_OPTS: "-Xmx4096m" + TEST_PROJECTS: "org.eclipse.kapua:kapua-security-test,org.eclipse.kapua:kapua-qa-integration,org.eclipse.kapua:kapua-scheduler-test,org.eclipse.kapua:kapua-user-test,org.eclipse.kapua:kapua-system-test,org.eclipse.kapua:kapua-job-test,org.eclipse.kapua:kapua-device-registry-test,org.eclipse.kapua:kapua-account-test,org.eclipse.kapua:kapua-tag-test,org.eclipse.kapua:kapua-translator-test" + APP_PROJECTS: "org.eclipse.kapua:kapua-service-authentication-app,org.eclipse.kapua:kapua-consumer-lifecycle-app,org.eclipse.kapua:kapua-consumer-telemetry-app" jobs: build: name: Build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - uses: actions/checkout@v3 # Checks out a copy of the repository on the ubuntu-latest machine - uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: 11 - cache: 'maven' - uses: actions/cache@v3 # Cache local Maven repository to reuse dependencies with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache - run: mvn -v - run: docker images -a # used as log (should show only github environment standard docker images; if kapua images are present, something is wrong) - run: mvn -B ${BUILD_OPTS} -DskipTests clean install @@ -30,749 +30,307 @@ jobs: test-brokerAcl: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@brokerAcl" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@brokerAcl' + needs-docker-images: 'true' test-tag: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@tag" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@tag' + needs-docker-images: 'false' test-broker: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@broker" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@broker' + needs-docker-images: 'true' test-device: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@device" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@device' + needs-docker-images: 'true' test-device-management: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@deviceManagement" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@deviceManagement' + needs-docker-images: 'true' test-connection: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@connection" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@connection' + needs-docker-images: 'true' test-datastore: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@datastore" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@datastore' + needs-docker-images: 'true' test-user: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@user" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@user' + needs-docker-images: 'false' test-userIntegrationBase: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@userIntegrationBase" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@userIntegrationBase' + needs-docker-images: 'true' test-userIntegration: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@userIntegration" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@userIntegration' + needs-docker-images: 'true' test-security: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@security" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@security' + needs-docker-images: 'false' test-jobsAndScheduler: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobs or @scheduler" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobs or @scheduler' + needs-docker-images: 'false' test-jobsIntegrationBase: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobsIntegrationBase" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobsIntegrationBase' + needs-docker-images: 'true' test-jobsIntegration: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobsIntegration" verify - - run: bash <(curl -s https://codecov.io/bash) - test-triggerService: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@triggerService" verify - - run: bash <(curl -s https://codecov.io/bash) - test-triggerServiceIntegrationBase: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@triggerServiceIntegrationBase" verify - - run: bash <(curl -s https://codecov.io/bash) - test-triggerServiceIntegration: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@triggerServiceIntegration" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobsIntegration' + needs-docker-images: 'true' test-accountAndTranslator: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@account or @translator" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@account or @translator' + needs-docker-images: 'false' test-jobEngineStepDefinitions: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineStepDefinitions" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineStepDefinitions' + needs-docker-images: 'true' test-jobEngineStartOfflineDevice: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineStartOfflineDevice" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineStartOfflineDevice' + needs-docker-images: 'true' test-jobEngineStartOnlineDevice: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineStartOnlineDevice" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineStartOnlineDevice' + needs-docker-images: 'true' test-jobEngineRestartOfflineDevice: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineRestartOfflineDevice" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineRestartOfflineDevice' + needs-docker-images: 'true' test-jobEngineRestartOnlineDevice: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineRestartOnlineDevice" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineRestartOnlineDevice' + needs-docker-images: 'true' test-jobEngineRestartOnlineDeviceSecondPart: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineRestartOnlineDeviceSecondPart" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineRestartOnlineDeviceSecondPart' + needs-docker-images: 'true' test-jobEngineServiceStop: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineServiceStop" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineServiceStop' + needs-docker-images: 'true' test-RoleAndGroup: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@role or @group" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@role or @group' + needs-docker-images: 'false' test-deviceRegistry: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@deviceRegistry" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@deviceRegistry' + needs-docker-images: 'true' test-endpoint: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@endpoint" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@endpoint' + needs-docker-images: 'true' junit-tests: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: 11 - cache: 'maven' - uses: actions/cache@v3 with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='org.eclipse.kapua.qa.markers.junit.JUnitTests' verify + key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache + - run: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='org.eclipse.kapua.qa.markers.junit.JUnitTests' verify - run: bash <(curl -s https://codecov.io/bash) build-javadoc: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: 11 - cache: 'maven' - uses: actions/cache@v3 with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache - run: mvn -B -DskipTests install javadoc:jar - run: bash <(curl -s https://codecov.io/bash)