diff --git a/.github/workflows/yaks-tests.yaml b/.github/workflows/yaks-tests.yaml index da874b9d1..81b8ae2dd 100644 --- a/.github/workflows/yaks-tests.yaml +++ b/.github/workflows/yaks-tests.yaml @@ -54,6 +54,18 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + - name: Set JitPack coordinates for pull requests + if: github.event_name == 'pull_request' + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + BASE_REPO: ${{ github.event.pull_request.base.repo.full_name }} + BASE_REF: ${{ github.base_ref }} + HEAD_REF: ${{ github.head_ref }} + run: | + echo "Set JitPack dependency coordinates to ${BASE_REPO/\//.}:${HEAD_REF/\//'~'}-SNAPSHOT" + + # Overwrite JitPack coordinates in the local Kamelets so the tests can use the utility classes in this PR + find kamelets -maxdepth 1 -name '*.kamelet.yaml' -exec sed -i "s/github:apache.camel-kamelets:camel-kamelets-utils:${BASE_REF}-SNAPSHOT/github:${BASE_REPO/\//.}:camel-kamelets-utils:${HEAD_REF/\//'~'}-SNAPSHOT/g" {} + - name: Get Camel K CLI run: | curl --fail -L --silent https://github.com/apache/camel-k/releases/download/v${CAMEL_K_VERSION}/camel-k-client-${CAMEL_K_VERSION}-linux-64bit.tar.gz -o kamel.tar.gz @@ -89,6 +101,7 @@ jobs: # TODO replaces the below statement with --operator-env-vars KAMEL_INSTALL_DEFAULT_KAMELETS=false # when we use camel k 1.8.0 kubectl delete kamelets --all + # Install the local kamelets find kamelets -maxdepth 1 -name '*.kamelet.yaml' -exec kubectl apply -f {} \; - name: Install YAKS