diff --git a/.github/workflows/ci-kubernetes.yml b/.github/workflows/ci-kubernetes.yml new file mode 100644 index 0000000000000..40990b9ce4f69 --- /dev/null +++ b/.github/workflows/ci-kubernetes.yml @@ -0,0 +1,116 @@ +name: Quarkus Kubernetes CI + +on: + workflow_dispatch: + schedule: + # 2am every weekday + saturday + - cron: '0 2 * * 1-6' + +env: + MAVEN_ARGS: -B -e + +jobs: + cache: + name: Build and save artifacts + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + cache: 'maven' + - name: Install artifacts + run: ./mvnw ${MAVEN_ARGS} -DskipTests -DskipITs -Dinvoker.skip clean install -pl :quarkus-integration-test-kubernetes-invoker -am + - name: Tar Maven repository + shell: bash + run: tar -I 'pigz -9' -cf maven-repo.tgz -C ~ .m2/repository + - name: Persist Maven repository + uses: actions/upload-artifact@v3 + with: + name: maven-repo + path: maven-repo.tgz + retention-days: 1 + + kubernetes: + name: Kubernetes Integration Tests + needs: cache + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + kubernetes: [v1.20.1] + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + - name: Download Maven repository + uses: actions/download-artifact@v3 + with: + name: maven-repo + path: . + - name: Extract Maven repository + shell: bash + run: tar -xzf maven-repo.tgz -C ~ + - name: Set up Minikube-Kubernetes + uses: manusa/actions-setup-minikube@v2.4.1 + with: + minikube version: v1.16.0 + kubernetes version: ${{ matrix.kubernetes }} + github token: ${{ secrets.GITHUB_TOKEN }} + start args: '--addons=metrics-server --force' + - name: Dockerhub login + uses: docker/login-action@v1 + with: + username: ${{ secrets.QUAY_QUARKUSCI_USERNAME }} + password: ${{ secrets.QUAY_QUARKUSCI_PASSWORD }} + - name: Run Kubernetes Invoker Tests + run: | + export QUARKUS_CONTAINER_IMAGE_GROUP=quarkustesting + export QUARKUS_CONTAINER_IMAGE_TAG=${{ github.sha }} + export QUARKUS_CONTAINER_IMAGE_REGISTRY=quay.io + ./mvnw ${MAVEN_ARGS} clean install -pl :quarkus-integration-test-kubernetes-invoker -Pkubernetes-e2e-tests + + openshift: + name: OpenShift Integration Tests + needs: cache + if: (event = pull_request.labeled && github.event.label.name == 'area/kubernetes') || (event != pull_request.labeled && contains(github.event.pull_request.labels.*.name, 'area/kubernetes') && ${{ secrets.QUAY_E2E_USERNAME}} != null }} && ${{ secrets.QUAY_E2E_PASSWORD != null }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + openshift: [v3.11.0] + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + - name: Download Maven repository + uses: actions/download-artifact@v3 + with: + name: maven-repo + path: . + - name: Extract Maven repository + shell: bash + run: tar -xzf maven-repo.tgz -C ~ + - name: Set up OpenShift + uses: manusa/actions-setup-openshift@v1.1.3 + with: + oc version: ${{ matrix.openshift }} + github token: ${{ secrets.GITHUB_TOKEN }} + - name: Dockerhub login + uses: docker/login-action@v1 + with: + username: ${{ secrets.QUAY_QUARKUSCI_USERNAME }} + password: ${{ secrets.QUAY_QUARKUSCI_PASSWORD }} + - name: Run OpenShift Invoker Tests + run: | + export QUARKUS_CONTAINER_IMAGE_GROUP=quarkustesting + export QUARKUS_CONTAINER_IMAGE_TAG=${{ github.sha }} + export QUARKUS_CONTAINER_IMAGE_REGISTRY=quay.io + ./mvnw ${MAVEN_ARGS} clean install -pl :quarkus-integration-test-kubernetes-invoker -Popenshift-e2e-tests