🐛 CP # 746 - Adding ability for provider and service client to shutdown grac… #1808
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Demo Testing | |
on: ["push", "pull_request"] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
outputs: | |
api_tests_ref: ${{ steps.extract-info.outputs.API_TESTS_REF }} | |
steps: | |
- name: Extract pull request number from inputs or PR description | |
id: extract-info | |
env: | |
PULL_REQUEST_BODY: ${{ github.event.pull_request.body }} | |
run: | | |
echo "IMG_JAVA_PROVIDER=ttl.sh/konveyor-java-external-provider-${GITHUB_SHA}:2h" >>$GITHUB_OUTPUT | |
echo "IMG_DOTNET_PROVIDER=ttl.sh/konveyor-dotnet-external-provider-${GITHUB_SHA}:2h" >>$GITHUB_OUTPUT | |
echo "IMG_GENERIC_PROVIDER=ttl.sh/konveyor-generic-external-provider-${GITHUB_SHA}:2h" >>$GITHUB_OUTPUT | |
echo "BUILD_BUNDLE=false" >> $GITHUB_OUTPUT | |
# if this is a PR, we should use the base branch | |
# else, use the branch on which this is running | |
if [ ! -z ${GITHUB_BASE_REF} ]; then | |
echo "Using ${GITHUB_BASE_REF}" | |
echo "API_TESTS_REF=${GITHUB_BASE_REF}" >> $GITHUB_OUTPUT | |
echo "ADDON_REF=${GITHUB_BASE_REF}" >>$GITHUB_OUTPUT | |
echo "JAVA_BUNDLE_REF=${GITHUB_BASE_REF}" >>$GITHUB_OUTPUT | |
else | |
echo "Using ${GITHUB_REF_NAME}" | |
echo "API_TESTS_REF=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT | |
echo "ADDON_REF=${GITHUB_REF_NAME}" >>$GITHUB_OUTPUT | |
echo "JAVA_BUNDLE_REF=${GITHUB_REF_NAME}" >>$GITHUB_OUTPUT | |
fi | |
# override with explicitely set value in PR description | |
echo "${PULL_REQUEST_BODY}" | |
ADDON_PULL_REQUEST_NUMBER=$(echo "${PULL_REQUEST_BODY}" | grep -oP '[A|a]ddon [P|p][R|r]: \K\d+' || true) | |
if [ ! -z "$ADDON_PULL_REQUEST_NUMBER" ]; then | |
echo "Using pull/${ADDON_PULL_REQUEST_NUMBER} for addon" | |
echo "ADDON_REF=refs/pull/$ADDON_PULL_REQUEST_NUMBER/merge" >>$GITHUB_OUTPUT | |
fi | |
JAVA_BUNDLE_PR_NUMBER=$(echo "${PULL_REQUEST_BODY}" | grep -oP '[B|b]undle [P|p][R|r]: \K\d+' || true) | |
if [ ! -z "$JAVA_BUNDLE_PR_NUMBER" ]; then | |
echo "Using bundle PR pull/${JAVA_BUNDLE_PR_NUMBER}" | |
echo "JAVA_BUNDLE_REF=refs/pull/$JAVA_BUNDLE_PR_NUMBER/merge" >> $GITHUB_OUTPUT | |
echo "BUILD_BUNDLE=true" >>$GITHUB_OUTPUT | |
fi | |
- uses: actions/checkout@v3 | |
if: steps.extract-info.outputs.BUILD_BUNDLE == 'true' | |
with: | |
fetch-depth: 0 | |
repository: konveyor/java-analyzer-bundle | |
ref: "${{ steps.extract-info.outputs.JAVA_BUNDLE_REF }}" | |
path: java-analyzer-bundle | |
- name: build java analyzer bundle image | |
if: steps.extract-info.outputs.BUILD_BUNDLE == 'true' | |
working-directory: java-analyzer-bundle | |
run: | | |
podman build -t quay.io/konveyor/jdtls-server-base:latest -f Dockerfile . | |
- uses: actions/checkout@v3 | |
# build all provider images and the analyzer-lsp image | |
- name: build images | |
run: | | |
make \ | |
IMG_JAVA_PROVIDER=${{steps.extract-info.outputs.IMG_JAVA_PROVIDER }}\ | |
IMG_DOTNET_PROVIDER=${{steps.extract-info.outputs.IMG_DOTNET_PROVIDER }}\ | |
IMG_GENERIC_PROVIDER=${{steps.extract-info.outputs.IMG_GENERIC_PROVIDER }}\ | |
build-external | |
podman build -t quay.io/konveyor/analyzer-lsp:latest -f Dockerfile . | |
# run the demo in a podman pod | |
- name: run demo image | |
run : | | |
make \ | |
IMG_JAVA_PROVIDER=${{steps.extract-info.outputs.IMG_JAVA_PROVIDER }}\ | |
IMG_DOTNET_PROVIDER=${{steps.extract-info.outputs.IMG_DOTNET_PROVIDER }}\ | |
IMG_GENERIC_PROVIDER=${{steps.extract-info.outputs.IMG_GENERIC_PROVIDER }}\ | |
run-external-providers-pod | |
podman build -f demo-local.Dockerfile -t localhost/testing:latest | |
make run-demo-image | |
- name: install yq for testing | |
run: go install github.com/mikefarah/yq/v4@latest | |
- name: ensure violation and dependency outputs are unchanged | |
run: | | |
diff \ | |
<(yq -P 'sort_keys(..)' -o=props <(git show HEAD:demo-output.yaml)) \ | |
<(yq -P 'sort_keys(..)' -o=props <(cat demo-output.yaml)) | |
diff \ | |
<(yq -P 'sort_keys(..)' -o=props <(git show HEAD:demo-dep-output.yaml)) \ | |
<(yq -P 'sort_keys(..)' -o=props <(cat demo-dep-output.yaml)) | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
repository: konveyor/tackle2-addon-analyzer | |
ref: ${{ steps.extract-info.outputs.ADDON_REF }} | |
path: tackle2-addon-analyzer | |
- name: Build addon and push images | |
working-directory: tackle2-addon-analyzer | |
run: | | |
IMG=ttl.sh/konveyor-tackle2-addon-analyzer-${GITHUB_SHA}:2h make image-podman | |
podman push ttl.sh/konveyor-tackle2-addon-analyzer-${GITHUB_SHA}:2h | |
podman push ${{steps.extract-info.outputs.IMG_JAVA_PROVIDER }} | |
podman push ${{steps.extract-info.outputs.IMG_DOTNET_PROVIDER }} | |
podman push ${{steps.extract-info.outputs.IMG_GENERIC_PROVIDER }} | |
- name: Make bundle image | |
uses: konveyor/operator/.github/actions/make-bundle@main | |
with: | |
operator_bundle: ttl.sh/konveyor-operator-bundle-${{ github.sha}}:2h | |
addon_analyzer: ttl.sh/konveyor-tackle2-addon-analyzer-${{ github.sha}}:2h | |
provider_generic: ${{steps.extract-info.outputs.IMG_GENERIC_PROVIDER }} | |
provider_java: ${{steps.extract-info.outputs.IMG_JAVA_PROVIDER }} | |
- name: push bundle image | |
run: | | |
docker push ttl.sh/konveyor-operator-bundle-${GITHUB_SHA}:2h | |
e2e: | |
needs: test | |
uses: konveyor/ci/.github/workflows/global-ci-bundle.yml@main | |
with: | |
operator_bundle: ttl.sh/konveyor-operator-bundle-${{ github.sha }}:2h | |
api_tests_ref: "${{ needs.test.outputs.api_tests_ref }}" |