Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Motivation: We should better use seperate workflows for PR and normal builds Modifications: - Split workflows - Better cache reuse Result: Cleanup
- Loading branch information
1 parent
33833de
commit cf4203f
Showing
4 changed files
with
200 additions
and
84 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/" |