netty5/.github/workflows/ci-build.yml
2020-12-22 19:30:57 +01:00

181 lines
5.9 KiB
YAML

name: Build project
on:
push:
branches: [ "4.1"]
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@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:
runs-on: ubuntu-latest
needs: verify
steps:
- uses: actions/checkout@v2
# Cache .m2/repository
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: build-linux-x86_64-java8-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-linux-x86_64-java8-${{ runner.os }}-maven-
# 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 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
- 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
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@v1
with:
path: ~/.m2/repository
key: build-linux-x86_64-java11-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-linux-x86_64-java11-${{ runner.os }}-maven-
# 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 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
- 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
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@v1
with:
path: ~/.m2/repository
key: build-linux-x86_64-java15-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-linux-x86_64-java15-${{ runner.os }}-maven-
# 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 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
- 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
if: ${{ failure() }}
with:
name: target
path: "**/target/"