-
Notifications
You must be signed in to change notification settings - Fork 2
131 lines (117 loc) · 4.67 KB
/
pull-request.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Build Pull Request
on:
pull_request:
branches:
- main
jobs:
build-and-test:
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ windows-latest, ubuntu-20.04, macos-latest ]
include:
- os: windows-latest
binary-file-extension: .exe
- os: ubuntu-20.04
binary-file-extension: ''
- os: macos-latest
binary-file-extension: ''
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
# - Install msttcorefonts, so we have the Verdana font available for diagram generation
# - Install graphviz, so we have the dot binary available for diagram generation
run: |-
find /etc/apt -type f -name '*.list' -exec sed -i -e '/dl.bintray.com\/sbt/d' "{}" \;
sudo apt-get update
echo msttcorefonts msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt-get install ttf-mscorefonts-installer
sudo apt-get install -y graphviz
sudo apt-get install -y build-essential libz-dev
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
# - Install graphviz, so we have the dot binary available for diagram generation
run: |-
choco install zip --execution-timeout=600
choco install unzip --execution-timeout=600
choco install graphviz --execution-timeout=600
shell: bash
- name: Install dependencies (MacOs)
if: runner.os == 'macOS'
# - Install graphviz, so we have the dot binary available for diagram generation
run: |-
brew install graphviz
- name: Setup JDK
uses: graalvm/setup-graalvm@b8dc5fccfbc65b21dd26e8341e7b21c86547f61b # v1
with:
java-version: '17.0.10'
distribution: 'graalvm'
components: 'native-image,js'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Configure Pagefile (Windows)
if: runner.os == 'Windows'
# Fix for "LINK : fatal error LNK1171: unable to load mspdbcore.dll (error code: 1455)":
# This seems to be caused by running out of memory; increasing page file
# size suggested here:
# https://github.com/actions/virtual-environments/issues/3420#issuecomment-861342418
uses: al-cheb/configure-pagefile-action@86589fd789a4de3e62ba628dda2cb10027b66d67 # v1.3
with:
minimum-size: 32GB
maximum-size: 32GB
disk-root: "C:"
- name: Set Swap Space (Linux)
if: runner.os == 'Linux'
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # master
with:
swap-size-gb: 12
- name: Build and run tests
run: |
mvn -B clean install
mvn -B clean verify -pl ret-cli -Pnative
mv ret-cli/target/ret${{ matrix.binary-file-extension }} ret-cli/target/ret-${{ runner.os }}-${{ runner.arch }}${{ matrix.binary-file-extension }}
shell: bash
- name: Switch to Temurin JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
overwrite-settings: false
- name: Test executable jar on Temurin
if: runner.os == 'Linux'
run: |
mvn -B -Dskip.maven.surefire -pl ret-cli failsafe:integration-test@default
- name: Compress executable
# UPX doesn't work on mac
if: runner.os != 'macOS'
uses: crazy-max/ghaction-upx@0fc45e912669ba9e8fa2b430e97c8da2a632e29b # v3.0.0
with:
version: latest
files: ret-cli/target/ret-${{ runner.os }}-${{ runner.arch }}${{ matrix.binary-file-extension }}
args: -9
- name: Upload jar
# We only need one OS job to upload the jar
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: ret-cli-jar
path: ret-cli/target/ret-cli-DEV-SNAPSHOT.jar
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: ret-cli-${{ runner.os }}
# .dlls only exist on Windows of course
path: |
ret-cli/target/ret-${{ runner.os }}-${{ runner.arch }}${{ matrix.binary-file-extension }}
ret-cli/target/*.dll