-
Notifications
You must be signed in to change notification settings - Fork 14
83 lines (82 loc) · 2.99 KB
/
build-external-pull-requests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Pull Request CI
on:
pull_request:
jobs:
Build-Foreign-Pull-Request:
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
strategy:
matrix:
os: [windows, macos, ubuntu]
jvm_version: [8, 11, 14]
runs-on: ${{ matrix.os }}-latest
env:
JAVA_VERSION: ${{ matrix.jvm_version }}
OS: ${{ matrix.os }}
TERM: dumb
steps:
# Checkout the repository
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Fetch tags
shell: bash
run: git fetch --tags -f
- name: Populate TAG and BRANCH environment variables
shell: bash
run: |
TAG=$(git describe --tags --exact-match HEAD || echo '')
echo "Current tag is: '$TAG' (setup in the TAG environment variable)"
echo "TAG=$TAG" >> $GITHUB_ENV
BRANCH=$([ -z "$TAG" ] && echo ${GITHUB_REF#refs/heads/} || echo $TAG)
echo "Current tag is: '$BRANCH' (setup in BRANCH TAG environment variable)"
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
# Check if the configuration is supported
# COMPATIBLE means the build can run on this matrix combination
# REFERENCE means this is the combination that produces the reference artifacts
# (hence, artifacts from REFERENCE configuration shall be deployed)
# Only one matrix entry should be REFERENCE=true
# If REFERENCE=true, then also COMPATIBLE=true
- shell: bash
run: .github/build-steps/compatibility_check.sh
# Install the JDK
- uses: joschi/[email protected]
if: ${{ env.COMPATIBLE }}
with:
java-version: ${{ matrix.jvm_version }}
# Install additional packages
- name: Configure Linux
shell: bash
if: ${{ env.COMPATIBLE && contains(matrix.os, 'ubuntu') }}
run: |
if [ -x .github/scripts/configure_linux ]; then
.github/scripts/configure_linux
fi
- name: Configure MacOS X
shell: bash
if: ${{ env.COMPATIBLE && contains(matrix.os, 'macos') }}
run: |
if [ -f .github/scripts/configure_macos ]; then
.github/scripts/configure_macos
fi
- name: Configure the Windows Pagefile
if: ${{ env.COMPATIBLE == 'true' && contains(matrix.os, 'windows') }}
uses: al-cheb/[email protected]
- name: Configure Windows
shell: bash
if: ${{ env.COMPATIBLE && contains(matrix.os, 'windows') }}
run: |
if [ -f .github/scripts/configure_windows ]; then
.github/scripts/configure_windows
fi
- name: Build
if: ${{ env.COMPATIBLE == 'true' }}
shell: bash
run: .github/build-steps/build.sh
- name: Check
if: ${{ env.COMPATIBLE == 'true' }}
shell: bash
run: .github/build-steps/check.sh
- name: CodeCov
if: ${{ env.REFERENCE == 'true' }}
uses: codecov/codecov-action@v1