140 lines
4.8 KiB
YAML
140 lines
4.8 KiB
YAML
|
name: Build PR
|
||
|
|
||
|
on:
|
||
|
pull_request:
|
||
|
branches: [ "master"]
|
||
|
|
||
|
# Allows you to run this workflow manually from the Actions tab
|
||
|
workflow_dispatch:
|
||
|
|
||
|
jobs:
|
||
|
verify-pr:
|
||
|
runs-on: ubuntu-18.04
|
||
|
steps:
|
||
|
- uses: actions/checkout@v2
|
||
|
- name: Set up JDK 11
|
||
|
uses: actions/setup-java@v1
|
||
|
with:
|
||
|
java-version: '11'
|
||
|
# 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-pr-aarch64:
|
||
|
name: linux-aarch64-verify-native
|
||
|
# The host should always be Linux
|
||
|
runs-on: ubuntu-20.04
|
||
|
needs: verify-pr
|
||
|
steps:
|
||
|
- uses: actions/checkout@v2
|
||
|
|
||
|
# Cache .m2/repository
|
||
|
- uses: actions/cache@v2
|
||
|
env:
|
||
|
cache-name: build-pr-aarch64-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-
|
||
|
|
||
|
- uses: uraimo/run-on-arch-action@v2.0.5
|
||
|
name: Run commands
|
||
|
id: runcmd
|
||
|
with:
|
||
|
arch: aarch64
|
||
|
distro: ubuntu20.04
|
||
|
|
||
|
# Not required, but speeds up builds by storing container images in
|
||
|
# a GitHub package registry.
|
||
|
githubToken: ${{ github.token }}
|
||
|
|
||
|
# Mount the .m2/repository
|
||
|
dockerRunArgs: |
|
||
|
--volume "/home/runner/.m2/repository/:/root/.m2/repository"
|
||
|
|
||
|
# Install dependencies
|
||
|
install: |
|
||
|
apt-get update -q -y
|
||
|
apt-get install -q -y openjdk-11-jdk autoconf automake libtool make tar maven git
|
||
|
|
||
|
# Compile native code and the modules it depend on and run NativeLoadingTest. This is enough to ensure
|
||
|
# we can load the native module on aarch64
|
||
|
run: |
|
||
|
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64 mvn -pl testsuite-native -am clean package -DskipTests=true -Dcheckstyle.skip=true -DskipNativeTestsuite=false
|
||
|
|
||
|
build-pr:
|
||
|
runs-on: ubuntu-latest
|
||
|
strategy:
|
||
|
matrix:
|
||
|
include:
|
||
|
- 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 }} build
|
||
|
needs: verify-pr
|
||
|
steps:
|
||
|
- uses: actions/checkout@v2
|
||
|
|
||
|
# Cache .m2/repository
|
||
|
- uses: actions/cache@v2
|
||
|
env:
|
||
|
cache-name: build-${{ matrix.setup }}-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.11
|
||
|
continue-on-error: true
|
||
|
with:
|
||
|
key: build-${{ matrix.setup }}-docker-cache-{hash}
|
||
|
restore-keys: |
|
||
|
build-${{ matrix.setup }}-docker-cache-
|
||
|
|
||
|
- name: Build docker image
|
||
|
run: docker-compose ${{ matrix.docker-compose-build }}
|
||
|
|
||
|
- name: Build project with leak detection
|
||
|
run: docker-compose ${{ matrix.docker-compose-run }} | tee build-leak.output
|
||
|
|
||
|
- name: Checking for test failures
|
||
|
run: ./.github/scripts/check_build_result.sh build-leak.output
|
||
|
|
||
|
- name: Checking for detected leak
|
||
|
run: ./.github/scripts/check_leak.sh build-leak.output
|
||
|
|
||
|
- name: Upload Test Results
|
||
|
if: always()
|
||
|
uses: actions/upload-artifact@v2
|
||
|
with:
|
||
|
name: test-results-${{ matrix.setup }}
|
||
|
path: '**/target/surefire-reports/TEST-*.xml'
|
||
|
|
||
|
- uses: actions/upload-artifact@v2
|
||
|
if: ${{ failure() }}
|
||
|
with:
|
||
|
name: build-${{ matrix.setup }}-target
|
||
|
path: "**/target/"
|
||
|
|