fix github actions build failure (#1054)

* test

* add timeout

* trigger

* add timeout to 60 min

* test

* test

* test

* fix what tests each instance is running

* github fix for abstract tests

* remove file

* removed echo

* test circleci

* escape

* single?

* test

* bigger timeout

* add a bit more debugging

* fix circleci

* split in half

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* circleci should work now

* circleci should work now

* drop splitting as it seems un-needed

* remove file when done

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* trigger

* trigger

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* trigger

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* trigger

* test

* test

* test

* test

* added README

* refactor load images

* enable reuse

* increaase timeout

* increaase timeout

* test

* test

* test

* test

* no return

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* test

* disable test

* pom

* enable test back
This commit is contained in:
erabii
2022-08-17 16:23:05 +03:00
committed by GitHub
parent 3b9bde7b19
commit d817507ac0
42 changed files with 479 additions and 394 deletions

View File

@@ -0,0 +1,11 @@
name: build controllers project
description: build controllers project
runs:
using: "composite"
steps:
- name: build controllers project
shell: bash
run: |
cd spring-cloud-kubernetes-controllers
.././mvnw -T 1C clean install
cd ..

View File

@@ -0,0 +1,12 @@
name: build integration tests project without tests
description: build integration tests project without tests
runs:
using: "composite"
steps:
- name: build integration tests project without tests
shell: bash
run: |
cd spring-cloud-kubernetes-integration-tests
# build the images, but dont run the tests
.././mvnw -T 1C clean install -DskipTests
cd ..

View File

@@ -0,0 +1,11 @@
name: cache
description: cache
runs:
using: "composite"
steps:
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-cache-${{ env.BRANCH_NAME }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-cache-${{ env.BRANCH_NAME }}-${{ hashFiles('**/pom.xml') }}

View File

@@ -0,0 +1,15 @@
# we are not going to use upload/download actions, since it is slower than cache usage
# as key to the cache we are going to use DOCKER_IMAGES_KEY, which is the same as GITHUB_RUN_ID
name: download docker images
description: download docker images
runs:
using: "composite"
steps:
- uses: actions/cache@v2
with:
path: /tmp/docker/images
key: docker-images-cache-${{ env.DOCKER_IMAGES_KEY }}
restore-keys: docker-images-cache-${{ env.DOCKER_IMAGES_KEY }}

View File

@@ -0,0 +1,10 @@
name: echo saved images
description: echo saved images
runs:
using: "composite"
steps:
- name: echo saved images
shell: bash
run: |
VIEW=$(ls -l /tmp/docker/images)
echo "${VIEW}"

View File

@@ -0,0 +1,10 @@
name: sets environment variables
description: sets environment variables
runs:
using: "composite"
steps:
- name: set env variables
shell: bash
run: |
echo "BRANCH_NAME=$(echo $GITHUB_HEAD_REF)" >> $GITHUB_ENV
echo "DOCKER_IMAGES_KEY=$(echo $GITHUB_RUN_ID)" >> $GITHUB_ENV

View File

@@ -0,0 +1,12 @@
name: run fabric8 istio integration test
description: run fabric8 istio integration test
runs:
using: "composite"
steps:
- name: run fabric8 istio integration test
shell: bash
run: |
docker load -i /tmp/docker/images/spring-cloud-kubernetes-fabric8-istio-it.tar
cd spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-fabric8-istio-it/
../.././mvnw clean install -Dskip.build.image=true
cd ../..

View File

@@ -0,0 +1,14 @@
# build a lightweight project so that dependencies for the
# maven-surefire-plugin are downloaded and thus cached also
name: build fabric8 istio project
description: build fabric8 istio projects
runs:
using: "composite"
steps:
- name: build fabric8 istio project
shell: bash
run: |
cd spring-cloud-kubernetes-fabric8-istio
.././mvnw -s ../.settings.xml clean install -U
cd ..

View File

@@ -0,0 +1,22 @@
name: install docker images
description: load docker images from tar
runs:
using: "composite"
steps:
- name: load docker images
shell: bash
run: |
# get the name of the images to load from children of spring-cloud-kubernetes-controllers
cd spring-cloud-kubernetes-controllers
while read controller_image; do
docker load -i /tmp/docker/images/${controller_image}.tar
done < <(mvn -Dexec.executable='echo' -Dexec.args='${project.artifactId}' exec:exec -q | grep -v 'spring-cloud-kubernetes-controllers')
cd ..
# get the name of the images to load from children of spring-cloud-kubernetes-integration-tests
cd spring-cloud-kubernetes-integration-tests
while read integration_test_image; do
docker load -i /tmp/docker/images/${integration_test_image}.tar
done < <(mvn -Dexec.executable='echo' -Dexec.args='${project.artifactId}' exec:exec -q | grep -v 'spring-cloud-kubernetes-integration-tests')
cd ..

View File

@@ -0,0 +1,15 @@
name: save controller docker images
description: save controller docker images
runs:
using: "composite"
steps:
- name: save controller docker images
shell: bash
run: |
mkdir -p /tmp/docker/images
TAG=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
cd spring-cloud-kubernetes-controllers
while read controller_image; do
docker save -o /tmp/docker/images/${controller_image}.tar docker.io/springcloud/${controller_image}:$TAG
done < <(mvn -Dexec.executable='echo' -Dexec.args='${project.artifactId}' exec:exec -q | grep -v 'spring-cloud-kubernetes-controllers')
cd ..

View File

@@ -0,0 +1,15 @@
name: save integration tests docker images
description: save integration tests docker images
runs:
using: "composite"
steps:
- name: save integration tests docker images
shell: bash
run: |
mkdir -p /tmp/docker/images
TAG=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
cd spring-cloud-kubernetes-integration-tests
while read integ_test; do
docker save -o /tmp/docker/images/${integ_test}.tar docker.io/springcloud/${integ_test}:$TAG
done < <(mvn -Dexec.executable='echo' -Dexec.args='${project.artifactId}' exec:exec -q | grep -v 'spring-cloud-kubernetes-integration-tests')
cd ..

View File

@@ -0,0 +1,9 @@
name: setup project
description: setup project
runs:
using: "composite"
steps:
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'

View File

@@ -0,0 +1,15 @@
# we are not going to use upload/download actions, since it is slower than cache usage
# as key to the cache we are going to use DOCKER_IMAGES_KEY, which is the same as GITHUB_RUN_ID
name: upload docker images
description: upload docker images
runs:
using: "composite"
steps:
- uses: actions/cache@v2
with:
path: /tmp/docker/images
key: docker-images-cache-${{ env.DOCKER_IMAGES_KEY }}
restore-keys: docker-images-cache-${{ env.DOCKER_IMAGES_KEY }}