2020-12-23 09:16:29 +01:00
|
|
|
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
|
|
|
|
|
2020-12-23 20:44:57 +01:00
|
|
|
build-pr:
|
2020-12-23 09:16:29 +01:00
|
|
|
runs-on: ubuntu-latest
|
2020-12-23 20:44:57 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- setup: linux-x86_64-java8
|
|
|
|
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml build"
|
|
|
|
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run build-leak"
|
|
|
|
- setup: linux-x86_64-java11
|
|
|
|
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build"
|
|
|
|
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak"
|
|
|
|
- setup: linux-x86_64-java15
|
|
|
|
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml build"
|
|
|
|
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.115.yaml run build-leak"
|
|
|
|
- setup: linux-x86_64-java11-boringssl
|
|
|
|
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build"
|
|
|
|
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak-boringssl-static"
|
|
|
|
|
|
|
|
name: ${{ matrix.setup }}
|
2020-12-23 09:16:29 +01:00
|
|
|
needs: verify
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
# Cache .m2/repository
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
env:
|
2020-12-23 20:44:57 +01:00
|
|
|
cache-name: build-${{ matrix.setup }}-cache-m2-repository
|
2020-12-23 09:16:29 +01:00
|
|
|
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:
|
2020-12-23 20:44:57 +01:00
|
|
|
key: build-${{ matrix.setup }}-docker-cache-{hash}
|
2020-12-23 09:16:29 +01:00
|
|
|
restore-keys: |
|
2020-12-23 20:44:57 +01:00
|
|
|
build-${{ matrix.setup }}-docker-cache-
|
2020-12-23 09:16:29 +01:00
|
|
|
|
|
|
|
- name: Build docker image
|
2020-12-23 20:44:57 +01:00
|
|
|
run: docker-compose ${{ matrix.docker-compose-build }}
|
2020-12-23 09:16:29 +01:00
|
|
|
|
|
|
|
- name: Build project with leak detection
|
2020-12-23 20:44:57 +01:00
|
|
|
run: docker-compose ${{ matrix.docker-compose-run }} | tee build-leak.output
|
2020-12-23 09:16:29 +01:00
|
|
|
|
|
|
|
- name: Checking for detected leak
|
|
|
|
run: ./.github/scripts/check_leak.sh build-leak.output
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
if: ${{ failure() }}
|
|
|
|
with:
|
2020-12-23 20:44:57 +01:00
|
|
|
name: build-${{ matrix.setup }}-target
|
2020-12-23 09:16:29 +01:00
|
|
|
path: "**/target/"
|
|
|
|
|