-
Notifications
You must be signed in to change notification settings - Fork 12
162 lines (143 loc) · 5.58 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Check New Pull Request
on:
pull_request:
branches:
- main
paths-ignore:
- 'documentation/decisions/**'
jobs:
build-and-test:
name: ${{ matrix.os }} build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [windows-latest, ubuntu-20.04, macos-13]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Check code style
if: matrix.os == 'ubuntu-20.04'
uses: dbelyaev/action-checkstyle@e89baf0f8b488b946345b7de8e975be1e3606387 # v1.5.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
checkstyle_config: esmf-checkstyle.xml
level: warning
fail_on_error: true
- name: Setup JDK
uses: graalvm/setup-graalvm@2f25c0caae5b220866f732832d5e3e29ff493338 # v1.2.1
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: 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: |
java --version
export MAVEN_OPTS="-Xmx4096m"
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
shell: bash
- name: Build native image
if: matrix.os != 'macos-13'
run: |
export MAVEN_OPTS="-Xmx4096m"
mvn -B -pl tools/samm-cli clean verify -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
shell: bash
- name: Build native image (Mac)
if: matrix.os == 'macos-13'
run: |
export MAVEN_OPTS="-Xmx4096m"
mvn -B -pl tools/samm-cli clean verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
bundle="samm-bundle-DEV-SNAPSHOT-$(date +%s)"
mkdir ${bundle}
curl -Lo jre.tar.gz https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jre_x64_mac_hotspot_21.0.3_9.tar.gz
tar -xvf jre.tar.gz
cp -r ./jdk-21.0.3+9-jre/Contents/Home ./${bundle}/jre
cp tools/samm-cli/target/samm-cli-DEV-SNAPSHOT.jar ./${bundle}/
cat <<EOF > ./${bundle}/run.sh
#!/usr/bin/env bash
HERE=\${BASH_SOURCE%/*}
"\$HERE/jre/bin/java" -jar "\$HERE/samm-cli-DEV-SNAPSHOT.jar" "\$@"
EOF
chmod +x ./${bundle}/run.sh
curl -Lo warp-packer https://github.com/dgiagio/warp/releases/download/v0.3.0/macos-x64.warp-packer
chmod +x warp-packer
./warp-packer --arch macos-x64 --input_dir ${bundle} --exec run.sh --output samm
chmod +x samm
shell: bash
- name: Create convenience batch file
if: matrix.os == 'windows-latest'
run: |
echo "start cmd /k samm.exe help" > tools/samm-cli/target/start-samm-cli.bat
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: matrix.os == 'ubuntu-20.04'
run: |
cd tools/samm-cli
mvn -B -Denforcer.skip -Dskip.maven.surefire failsafe:integration-test -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
- name: Upload executable jar
# We only need one OS job to upload the jar
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v4
with:
name: samm-cli-jar
path: tools/samm-cli/target/samm-cli-*.jar
- name: Upload binary (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: samm-cli-binary-${{ matrix.os }}
path: |
tools/samm-cli/target/samm.exe
tools/samm-cli/target/*.dll
tools/samm-cli/target/*.bat
tools/samm-cli/target/lib/
- name: Upload binary (Linux)
if: matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v4
with:
name: samm-cli-binary-${{ matrix.os }}
path: |
tools/samm-cli/target/samm
tools/samm-cli/target/*.so
- name: Upload binary (Mac)
if: matrix.os == 'macos-13'
uses: actions/upload-artifact@v4
with:
name: samm-cli-binary-${{ matrix.os }}
path: |
samm