-
Notifications
You must be signed in to change notification settings - Fork 2
138 lines (123 loc) · 4.69 KB
/
pull-request-check.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
132
133
134
135
136
137
138
name: Build Pull Request
on:
pull_request:
branches:
- main
jobs:
build-and-test:
name: ${{ matrix.os }} build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [windows-latest, ubuntu-20.04, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-20.04'
# - 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: matrix.os == 'windows-latest'
# - 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: matrix.os == 'macos-latest'
# - Install graphviz, so we have the dot binary available for diagram generation
run: |-
brew install graphviz
- name: Setup JDK
uses: graalvm/setup-graalvm@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@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Configure Pagefile (Windows)
if: matrix.os == 'windows-latest'
# 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: matrix.os == 'ubuntu-20.04'
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
shell: bash
- name: Switch to Temurin JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
overwrite-settings: false
- name: Test executable jar on Temurin
if: matrix.os == 'ubuntu-20.04'
run: |
mvn -B -Dskip.maven.surefire -pl ret-cli failsafe:integration-test@default
- name: Run UPX (Linux)
# UPX doesn't work on mac
if: matrix.os == 'ubuntu-20.04'
uses: crazy-max/ghaction-upx@0fc45e912669ba9e8fa2b430e97c8da2a632e29b # v3.0.0
with:
version: latest
files: ret-cli/target/ret
args: -9
- name: Run UPX (Windows)
if: matrix.os == 'windows-latest'
uses: crazy-max/ghaction-upx@0fc45e912669ba9e8fa2b430e97c8da2a632e29b # v3.0.0
with:
version: latest
files: ret-cli/target/ret.exe
args: -9
- name: Upload executable jar
# We only need one OS job to upload the jar
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v3
with:
name: ret-cli-jar
path: ret-cli/target/ret-cli-DEV-SNAPSHOT.jar
- name: Upload binary (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: ret-cli-${{ matrix.os }}
path: |
ret-cli/target/ret.exe
ret-cli/target/*.dll
- name: Upload binary (Linux/Mac)
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: ret-cli-${{ matrix.os }}
path: |
ret-cli/target/ret