Split pr and normal build (#10884)
Motivation: We should better use seperate workflows for PR and normal builds Modifications: - Split workflows - Better cache reuse Result: Cleanup
This commit is contained in:
parent
33833dec26
commit
9da336f2fc
15
.github/scripts/check_leak.sh
vendored
Executable file
15
.github/scripts/check_leak.sh
vendored
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$#" -ne 1 ]; then
|
||||||
|
echo "Expected build log as argument"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -q 'LEAK:' $1 ; then
|
||||||
|
echo "Leak detected, please inspect build log"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "No Leak detected"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
97
.github/workflows/ci-build.yml
vendored
97
.github/workflows/ci-build.yml
vendored
@ -3,8 +3,6 @@ name: Build project
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "4.1"]
|
branches: [ "4.1"]
|
||||||
pull_request:
|
|
||||||
branches: [ "4.1"]
|
|
||||||
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '30 1 * * 1' # At 01:30 on Monday, every Monday.
|
- cron: '30 1 * * 1' # At 01:30 on Monday, every Monday.
|
||||||
@ -13,38 +11,22 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
verify:
|
|
||||||
runs-on: ubuntu-18.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Set up JDK 8
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 8
|
|
||||||
# Cache .m2/repository
|
|
||||||
- uses: actions/cache@v1
|
|
||||||
with:
|
|
||||||
path: ~/.m2/repository
|
|
||||||
key: verify-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
||||||
restore-keys: |
|
|
||||||
verify-${{ runner.os }}-maven-
|
|
||||||
|
|
||||||
- name: Verify with Maven
|
|
||||||
run: mvn verify -B --file pom.xml -DskipTests=true
|
|
||||||
|
|
||||||
build-linux-x86_64-java8:
|
build-linux-x86_64-java8:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: verify
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
# Cache .m2/repository
|
# Cache .m2/repository
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v2
|
||||||
|
env:
|
||||||
|
cache-name: build-linux-x86_64-java8-cache-m2-repository
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: build-linux-x86_64-java8-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
build-linux-x86_64-java8-${{ runner.os }}-maven-
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||||
|
${{ runner.os }}-build-
|
||||||
|
|
||||||
# Enable caching of Docker layers
|
# Enable caching of Docker layers
|
||||||
- uses: satackey/action-docker-layer-caching@v0.0.8
|
- uses: satackey/action-docker-layer-caching@v0.0.8
|
||||||
@ -58,23 +40,8 @@ jobs:
|
|||||||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml build
|
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml build
|
||||||
|
|
||||||
- name: Build project without leak detection
|
- name: Build project without leak detection
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/4.1' }}
|
|
||||||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run build
|
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run build
|
||||||
|
|
||||||
- name: Build project with leak detection
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run build-leak | tee build-leak.output
|
|
||||||
|
|
||||||
- name: Checking for detected leak
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
run: |
|
|
||||||
if grep -q 'LEAK:' build-leak.output ; then
|
|
||||||
echo "Leak detected, please inspect build log"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "No Leak detected"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
with:
|
with:
|
||||||
@ -83,17 +50,19 @@ jobs:
|
|||||||
|
|
||||||
build-linux-x86_64-java11:
|
build-linux-x86_64-java11:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: verify
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
# Cache .m2/repository
|
# Cache .m2/repository
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v2
|
||||||
|
env:
|
||||||
|
cache-name: build-linux-x86_64-java11-cache-m2-repository
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: build-linux-x86_64-java11-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
build-linux-x86_64-java11-${{ runner.os }}-maven-
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||||
|
${{ runner.os }}-build-
|
||||||
|
|
||||||
# Enable caching of Docker layers
|
# Enable caching of Docker layers
|
||||||
- uses: satackey/action-docker-layer-caching@v0.0.8
|
- uses: satackey/action-docker-layer-caching@v0.0.8
|
||||||
@ -107,23 +76,8 @@ jobs:
|
|||||||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build
|
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build
|
||||||
|
|
||||||
- name: Build project without leak detection
|
- name: Build project without leak detection
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/4.1' }}
|
|
||||||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build
|
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build
|
||||||
|
|
||||||
- name: Build project with leak detection
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak | tee build-leak.output
|
|
||||||
|
|
||||||
- name: Checking for detected leak
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
run: |
|
|
||||||
if grep -q 'LEAK:' build-leak.output ; then
|
|
||||||
echo "Leak detected, please inspect build log"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "No Leak detected"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
with:
|
with:
|
||||||
@ -132,17 +86,19 @@ jobs:
|
|||||||
|
|
||||||
build-linux-x86_64-java15:
|
build-linux-x86_64-java15:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: verify
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
# Cache .m2/repository
|
# Cache .m2/repository
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v2
|
||||||
|
env:
|
||||||
|
cache-name: build-linux-x86_64-java15-cache-m2-repository
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: build-linux-x86_64-java15-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
build-linux-x86_64-java15-${{ runner.os }}-maven-
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||||
|
${{ runner.os }}-build-
|
||||||
|
|
||||||
# Enable caching of Docker layers
|
# Enable caching of Docker layers
|
||||||
- uses: satackey/action-docker-layer-caching@v0.0.8
|
- uses: satackey/action-docker-layer-caching@v0.0.8
|
||||||
@ -156,23 +112,8 @@ jobs:
|
|||||||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml build
|
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml build
|
||||||
|
|
||||||
- name: Build project without leak detection
|
- name: Build project without leak detection
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/4.1' }}
|
|
||||||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml run build
|
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml run build
|
||||||
|
|
||||||
- name: Build project with leak detection
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml run build-leak | tee build-leak.output
|
|
||||||
|
|
||||||
- name: Checking for detected leak
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
run: |
|
|
||||||
if grep -q 'LEAK:' build-leak.output ; then
|
|
||||||
echo "Leak detected, please inspect build log"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "No Leak detected"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
with:
|
with:
|
||||||
|
30
.github/workflows/ci-deploy.yml
vendored
30
.github/workflows/ci-deploy.yml
vendored
@ -26,20 +26,25 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
# Cache .m2/repository
|
# Cache .m2/repository
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v2
|
||||||
|
env:
|
||||||
|
cache-name: deploy-linux-x86_64-cache-m2-repository
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: deploy-linux-x86_64-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-deploy-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
deploy-linux-x86_64-${{ runner.os }}-maven-
|
${{ runner.os }}-deploy-${{ env.cache-name }}-
|
||||||
|
${{ runner.os }}-deploy-
|
||||||
|
|
||||||
# Enable caching of Docker layers
|
# Enable caching of Docker layers
|
||||||
- uses: satackey/action-docker-layer-caching@v0.0.8
|
- uses: satackey/action-docker-layer-caching@v0.0.8
|
||||||
|
env:
|
||||||
|
docker-cache-name: deploy-linux-x86_64-cache-docker
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
key: deploy-linux-x86_64-docker-cache-{hash}
|
key: ${{ runner.os }}-deploy-${{ env.docker-cache-name }}-{hash}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
deploy-linux-x86_64-docker-cache-
|
${{ runner.os }}-deploy-${{ env.docker-cache-name }}-
|
||||||
|
|
||||||
- name: Build docker image
|
- name: Build docker image
|
||||||
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml build
|
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml build
|
||||||
@ -64,20 +69,25 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
# Cache .m2/repository
|
# Cache .m2/repository
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v2
|
||||||
|
env:
|
||||||
|
cache-name: deploy-linux-aarch64-cache-m2-repository
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: deploy-linux-aarch64-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-deploy-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
deploy-linux-aarch64-${{ runner.os }}-maven-
|
${{ runner.os }}-deploy-${{ env.cache-name }}-
|
||||||
|
${{ runner.os }}-deploy-
|
||||||
|
|
||||||
# Enable caching of Docker layers
|
# Enable caching of Docker layers
|
||||||
- uses: satackey/action-docker-layer-caching@v0.0.8
|
- uses: satackey/action-docker-layer-caching@v0.0.8
|
||||||
|
env:
|
||||||
|
docker-cache-name: deploy-linux-aarch64-cache-docker
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
key: deploy-linux-aarch64-docker-cache-{hash}
|
key: ${{ runner.os }}-deploy-${{ env.docker-cache-name }}-{hash}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
deploy-linux-aarch64-docker-cache-
|
${{ runner.os }}-deploy-${{ env.docker-cache-name }}-
|
||||||
|
|
||||||
- name: Build docker image
|
- name: Build docker image
|
||||||
run: docker-compose -f docker/docker-compose.centos-7.yaml build
|
run: docker-compose -f docker/docker-compose.centos-7.yaml build
|
||||||
|
154
.github/workflows/ci-pr.yml
vendored
Normal file
154
.github/workflows/ci-pr.yml
vendored
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
name: Build PR
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [ "4.1"]
|
||||||
|
|
||||||
|
schedule:
|
||||||
|
- cron: '30 1 * * 1' # At 01:30 on Monday, every Monday.
|
||||||
|
|
||||||
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
verify:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up JDK 8
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 8
|
||||||
|
# Cache .m2/repository
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
env:
|
||||||
|
cache-name: verify-cache-m2-repository
|
||||||
|
with:
|
||||||
|
path: ~/.m2/repository
|
||||||
|
key: ${{ runner.os }}-pr-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pr-${{ env.cache-name }}-
|
||||||
|
${{ runner.os }}-pr-
|
||||||
|
|
||||||
|
- name: Verify with Maven
|
||||||
|
run: mvn verify -B --file pom.xml -DskipTests=true
|
||||||
|
|
||||||
|
build-linux-x86_64-java8:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: verify
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Cache .m2/repository
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
env:
|
||||||
|
cache-name: build-linux-x86_64-java8-cache-m2-repository
|
||||||
|
with:
|
||||||
|
path: ~/.m2/repository
|
||||||
|
key: ${{ runner.os }}-pr-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pr-${{ env.cache-name }}-
|
||||||
|
${{ runner.os }}-pr-
|
||||||
|
|
||||||
|
# Enable caching of Docker layers
|
||||||
|
- uses: satackey/action-docker-layer-caching@v0.0.8
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
key: build-linux-x86_64-java8-docker-cache-{hash}
|
||||||
|
restore-keys: |
|
||||||
|
build-linux-x86_64-java8-docker-cache-
|
||||||
|
|
||||||
|
- name: Build docker image
|
||||||
|
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml build
|
||||||
|
|
||||||
|
- name: Build project with leak detection
|
||||||
|
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run build-leak | tee build-leak.output
|
||||||
|
|
||||||
|
- name: Checking for detected leak
|
||||||
|
run: ./.github/scripts/check_leak.sh build-leak.output
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: ${{ failure() }}
|
||||||
|
with:
|
||||||
|
name: target
|
||||||
|
path: "**/target/"
|
||||||
|
|
||||||
|
build-linux-x86_64-java11:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: verify
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Cache .m2/repository
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
env:
|
||||||
|
cache-name: build-linux-x86_64-java11-cache-m2-repository
|
||||||
|
with:
|
||||||
|
path: ~/.m2/repository
|
||||||
|
key: ${{ runner.os }}-pr-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pr-${{ env.cache-name }}-
|
||||||
|
${{ runner.os }}-pr-
|
||||||
|
|
||||||
|
# Enable caching of Docker layers
|
||||||
|
- uses: satackey/action-docker-layer-caching@v0.0.8
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
key: build-linux-x86_64-java11-docker-cache-{hash}
|
||||||
|
restore-keys: |
|
||||||
|
build-linux-x86_64-java11-docker-cache-
|
||||||
|
|
||||||
|
- name: Build docker image
|
||||||
|
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build
|
||||||
|
|
||||||
|
- name: Build project with leak detection
|
||||||
|
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak | tee build-leak.output
|
||||||
|
|
||||||
|
- name: Checking for detected leak
|
||||||
|
run: ./.github/scripts/check_leak.sh build-leak.output
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: ${{ failure() }}
|
||||||
|
with:
|
||||||
|
name: target
|
||||||
|
path: "**/target/"
|
||||||
|
|
||||||
|
build-linux-x86_64-java15:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: verify
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Cache .m2/repository
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
env:
|
||||||
|
cache-name: build-linux-x86_64-java15-cache-m2-repository
|
||||||
|
with:
|
||||||
|
path: ~/.m2/repository
|
||||||
|
key: ${{ runner.os }}-pr-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pr-${{ env.cache-name }}-
|
||||||
|
${{ runner.os }}-pr-
|
||||||
|
|
||||||
|
# Enable caching of Docker layers
|
||||||
|
- uses: satackey/action-docker-layer-caching@v0.0.8
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
key: build-linux-x86_64-java15-docker-cache-{hash}
|
||||||
|
restore-keys: |
|
||||||
|
build-linux-x86_64-java15-docker-cache-
|
||||||
|
|
||||||
|
- name: Build docker image
|
||||||
|
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml build
|
||||||
|
|
||||||
|
- name: Build project with leak detection
|
||||||
|
run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml run build-leak | tee build-leak.output
|
||||||
|
|
||||||
|
- name: Checking for detected leak
|
||||||
|
run: ./.github/scripts/check_leak.sh build-leak.output
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: ${{ failure() }}
|
||||||
|
with:
|
||||||
|
name: target
|
||||||
|
path: "**/target/"
|
Loading…
x
Reference in New Issue
Block a user