Skip to content

Commit

Permalink
fix: less minikube downloads and starts in CI
Browse files Browse the repository at this point in the history
Signed-off-by: xstefank <[email protected]>
  • Loading branch information
xstefank committed Feb 26, 2025
1 parent ea57fed commit 847b960
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 100 deletions.
72 changes: 0 additions & 72 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,83 +11,11 @@ on:
required: true

jobs:
set_up_kubernetes:
name: Set up Kubernetes ${{ inputs.kube-version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Minikube
uses: manusa/[email protected]
with:
minikube version: 'v1.34.0'
kubernetes version: '${{ inputs.kube-version }}'
driver: 'docker'
github token: ${{ secrets.GITHUB_TOKEN }}

- name: Save minikube directory
id: minikube
run: |
echo "minikube-dir=$MINIKUBE_HOME" >> $GITHUB_OUTPUT
- name: Upload minikube
uses: actions/upload-artifact@v4
with:
name: minikube-${{ inputs.kube-version }}
path: ${{ steps.minikube.outputs.minikube-dir }}
include-hidden-files: true

integration_tests:
name: "JDK: ${{ matrix.java }}, IT category: ${{ matrix.it-category }}"
needs: set_up_kubernetes
strategy:
matrix:
java: [ 17, 21 ]
it-category: [ 'baseapi', 'dependent', 'workflow' ]
uses: ./.github/workflows/integration-tests.yml
with:
kube-version: ${{ inputs.kube-version }}
java-version: ${{ matrix.java }}
it-category: ${{ matrix.it-category }}

http_client_tests:
name: "JDK: ${{ matrix.java }}, IT category: ${{ matrix.it-category }}, HTTP client: ${{ matrix.httpclient }}"
needs: set_up_kubernetes
strategy:
matrix:
java: [ 17, 21 ]
it-category: [ 'baseapi' ]
httpclient: [ 'vertx', 'jdk', 'jetty' ]
uses: ./.github/workflows/integration-tests.yml
with:
kube-version: ${{ inputs.kube-version }}
java-version: ${{ matrix.java }}
it-category: ${{ matrix.it-category }}
http-client: ${{ matrix.httpclient }}

special_integration_tests:
name: "Special integration tests (${{ matrix.java }})"
needs: set_up_kubernetes
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17, 21 ]
steps:
- uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
- name: Run Special Integration Tests
run: ./mvnw ${MAVEN_ARGS} -B package -P minimal-watch-timeout-dependent-it --file pom.xml

delete_kubernetes:
needs: [ integration_tests, http_client_tests, special_integration_tests ]
if: always()
name: Delete Kubernetes ${{ inputs.kube-version }} artifact
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: minikube-${{ inputs.kube-version }}
72 changes: 45 additions & 27 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,19 @@ on:
type: string
required: false
default: ''
it-category:
type: string
required: false
default: ''

jobs:
integration_tests:
name: "Experimental: ${{ inputs.experimental }}, Checkout ref: ${{ inputs.checkout-ref }}"
name: |
Integration tests:
JDK: ${{ inputs.java-version }}
Kube: ${{ inputs.kube-version }}
Experimental: ${{ inputs.experimental }}
Checkout ref: ${{ inputs.checkout-ref }}
runs-on: ubuntu-latest
continue-on-error: ${{ inputs.experimental }}
timeout-minutes: 40
steps:
- name: Output test information
run: echo "Running ITs with ${{ inputs.http-client }}, ${{ inputs.kube-version }}, ${{ inputs.java-version }}"
- uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout-ref }}
Expand All @@ -44,25 +43,44 @@ jobs:
distribution: temurin
java-version: ${{ inputs.java-version }}
cache: 'maven'
- name: Download minikube artifact for Kubernetes ${{ inputs.kube-version }}
uses: actions/download-artifact@v4
- name: Set up Minikube
uses: manusa/[email protected]
with:
name: minikube-${{inputs.kube-version}}
path: minikube
- name: Start minikube with Kubernetes ${{ inputs.kube-version }}
minikube version: 'v1.34.0'
kubernetes version: '${{ inputs.kube-version }}'
driver: 'docker'
github token: ${{ secrets.GITHUB_TOKEN }}
- name: "Run tests"
run: |
# wait for docker
docker version -f '{{.Server.Version}} - {{.Client.Version}}'
export MINIKUBE_HOME=$PWD/minikube
minikube start --driver=docker
kubectl version
- name: "${{inputs.it-category}} integration tests (kube: ${{ inputs.kube-version }} / java: ${{ inputs.java-version }} / client: ${{ inputs.http-client }})"
run: |
if [ -z "${{inputs.it-category}}" ]; then
it_profile="integration-tests"
else
it_profile="integration-tests-${{inputs.it-category}}"
fi
echo "Using profile: ${it_profile}"
./mvnw ${MAVEN_ARGS} -T1C -B install -DskipTests -Pno-apt --file pom.xml
./mvnw ${MAVEN_ARGS} -T1C -B package -P${it_profile} -Dfabric8-httpclient-impl.name=${{inputs.http-client}} --file pom.xml
echo "Running tests..."
./mvnw ${MAVEN_ARGS} -T1C -B install -DskipTests --file pom.xml
echo -e "\n\n"
echo "Running baseapi integration tests with the default HTTP client..."
# ./mvnw ${MAVEN_ARGS} -T1C -B package -Pintegration-tests-baseapi --file pom.xml

echo "Running dependent integration tests with the default HTTP client..."
# ./mvnw ${MAVEN_ARGS} -T1C -B package -Pintegration-tests-dependent --file pom.xml

echo "Running workflow integration tests with the default HTTP client..."
# ./mvnw ${MAVEN_ARGS} -T1C -B package -Pintegration-tests-worklow --file pom.xml

echo "Running minimal-watch-timeout-dependent-it integration tests with the default HTTP client..."
# ./mvnw ${MAVEN_ARGS} -T1C -B package -Pminimal-watch-timeout-dependent-it --file pom.xml

echo "Running all integration tests with the default HTTP client..."
# ./mvnw ${MAVEN_ARGS} -T1C -B package -Pintegration-tests --file pom.xml

echo "Running all end-to-end tests with the default HTTP client..."
# ./mvnw ${MAVEN_ARGS} -T1C -B package -Pend-to-end-tests --file pom.xml

echo "Running baseapi integration tests with the Vert.x HTTP client..."
# ./mvnw ${MAVEN_ARGS} -T1C -B package -Pintegration-tests-baseapi -Dfabric8-httpclient-impl.name=vertx --file pom.xml

echo "Running baseapi integration tests with the JDK HTTP client..."
# ./mvnw ${MAVEN_ARGS} -T1C -B package -Pintegration-tests-baseapi -Dfabric8-httpclient-impl.name=jdk --file pom.xml

echo "Running baseapi integration tests with the Jetty HTTP client..."
# ./mvnw ${MAVEN_ARGS} -T1C -B package -Pintegration-tests-baseapi -Dfabric8-httpclient-impl.name=jetty --file pom.xml


3 changes: 2 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
workflow_dispatch:
jobs:
check_format_and_unit_tests:
name: Check format and unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -31,7 +32,7 @@ jobs:
run: ./mvnw ${MAVEN_ARGS} clean install -Pno-apt --file pom.xml

build:
name: Integration tests with Kubernetes ${{ matrix.kubernetes }}
name: "Integration tests (Kube: ${{ matrix.kubernetes }})"
strategy:
matrix:
kubernetes: [ 'v1.29.12','1.30.8', '1.31.4', '1.32.0' ]
Expand Down

0 comments on commit 847b960

Please sign in to comment.