-
Notifications
You must be signed in to change notification settings - Fork 8
215 lines (176 loc) · 10.5 KB
/
Copy pathmultiplatform-test.yml
File metadata and controls
215 lines (176 loc) · 10.5 KB
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: Multi Platform Runner
on:
workflow_dispatch:
# TODO:
# Verify built image is able to run..
# Add test projects for java 8 and java 11 (older spring/quarkus levels needed)
jobs:
integration-tests:
strategy:
# Each test is a different scenario, do not cancel running tests if one fails.
fail-fast: false
matrix:
projects:
- { project: "hello-spring", java: "17", label: "U-P5-RL-J17-S", runner: "ubuntu-24.04", runtime: "podman5", root: "rootless" }
- { project: "hello-spring", java: "17", label: "U-P4-RL-J17-S", runner: "ubuntu-24.04", runtime: "podman4", root: "rootless" }
- { project: "hello-spring", java: "17", label: "U-P5-RF-J17-S", runner: "ubuntu-24.04", runtime: "podman5", root: "rootful" }
- { project: "hello-spring", java: "17", label: "U-P4-RF-J17-S", runner: "ubuntu-24.04", runtime: "podman4", root: "rootful" }
- { project: "hello-spring", java: "17", label: "U-D-RL-J17-S", runner: "ubuntu-24.04", runtime: "docker" }
- { project: "hello-spring", java: "17", label: "W-D-RL-J17-S", runner: "windows-latest", runtime: "docker" }
- { project: "hello-quarkus", java: "17", label: "U-P5-RL-J17-Q", runner: "ubuntu-24.04", runtime: "podman5", root: "rootless" }
- { project: "hello-quarkus", java: "17", label: "U-P4-RL-J17-Q", runner: "ubuntu-24.04", runtime: "podman4", root: "rootless" }
- { project: "hello-quarkus", java: "17", label: "U-P5-RF-J17-Q", runner: "ubuntu-24.04", runtime: "podman5", root: "rootful" }
- { project: "hello-quarkus", java: "17", label: "U-P4-RF-J17-Q", runner: "ubuntu-24.04", runtime: "podman4", root: "rootful" }
- { project: "hello-quarkus", java: "17", label: "U-D-RL-J17-Q", runner: "ubuntu-24.04", runtime: "docker" }
- { project: "hello-spring", java: "17", label: "W-D-RL-J17-Q", runner: "windows-latest", runtime: "docker" }
- { project: "hello-spring", java: "21", label: "U-P5-RL-J21-S", runner: "ubuntu-24.04", runtime: "podman5", root: "rootless" }
- { project: "hello-spring", java: "21", label: "U-P4-RL-J21-S", runner: "ubuntu-24.04", runtime: "podman4", root: "rootless" }
- { project: "hello-spring", java: "21", label: "U-P5-RF-J21-S", runner: "ubuntu-24.04", runtime: "podman5", root: "rootful" }
- { project: "hello-spring", java: "21", label: "U-P4-RF-J21-S", runner: "ubuntu-24.04", runtime: "podman4", root: "rootful" }
- { project: "hello-spring", java: "21", label: "U-D-RL-J21-S", runner: "ubuntu-24.04", runtime: "docker" }
- { project: "hello-spring", java: "21", label: "W-D-RL-J21-S", runner: "windows-latest", runtime: "docker" }
- { project: "hello-quarkus", java: "21", label: "U-P5-RL-J21-Q", runner: "ubuntu-24.04", runtime: "podman5", root: "rootless" }
- { project: "hello-quarkus", java: "21", label: "U-P4-RL-J21-Q", runner: "ubuntu-24.04", runtime: "podman4", root: "rootless" }
- { project: "hello-quarkus", java: "21", label: "U-P5-RF-J21-Q", runner: "ubuntu-24.04", runtime: "podman5", root: "rootful" }
- { project: "hello-quarkus", java: "21", label: "U-P4-RF-J21-Q", runner: "ubuntu-24.04", runtime: "podman4", root: "rootful" }
- { project: "hello-quarkus", java: "21", label: "U-D-RL-J21-Q", runner: "ubuntu-24.04", runtime: "docker" }
- { project: "hello-spring", java: "21", label: "W-D-RL-J21-Q", runner: "windows-latest", runtime: "docker" }
runs-on: [ "${{ matrix.projects.runner }}" ]
# Keep name short, as github ui does not allow many characters to be displayed
name: ${{ matrix.projects.label }}
steps:
# Maybe no longer required now lib doesn't attempt to download the planet when getting tagless images.
- name: Freee Disk Space for Ubuntu
if: matrix.projects.runner == 'ubuntu-24.04'
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: false
# Configure podman for ubuntu
- name: Podman4 Ubuntu
if: matrix.projects.runner == 'ubuntu-24.04' && matrix.projects.runtime == 'podman4'
run: |
echo "Configuring Podman 4 for ubuntu"
# reconfigure timeouts for podman to be compatible with java docker api
sudo mkdir -p /etc/containers/containers.conf.d
printf "[engine]\nservice_timeout=91\n" | sudo tee -a /etc/containers/containers.conf.d/service-timeout.conf
# start the podman user socket
systemctl --user start podman.socket
- name: Set up Homebrew
if: matrix.projects.runner == 'ubuntu-24.04' && matrix.projects.runtime == 'podman5'
uses: Homebrew/actions/setup-homebrew@master
- name: Podman5 Ubuntu
if: matrix.projects.runner == 'ubuntu-24.04' && matrix.projects.runtime == 'podman5'
run: |
echo "Configuring Podman 5 for ubuntu"
# Remove the old crun executable to let brew to install a newer one ...
sudo apt-get remove crun
# Use brew to install podman 5
brew install podman
brew services start podman
# reconfigure timeouts for podman to be compatible with java docker api
sudo mkdir -p /etc/containers/containers.conf.d
printf "[engine]\nservice_timeout=91\n" | sudo tee -a /etc/containers/containers.conf.d/service-timeout.conf
# restart to allow config to take effect
brew services restart podman
- name: Podman Rootful (podman machine)
if: matrix.projects.runner == 'windows-latest' && (matrix.projects.runtime == 'podman5' || matrix.projects.runtime == 'podman4') && matrix.projects.root == 'rootful'
run: |
podman system connection ls
podman machine stop
podman machine set --rootful=true
podman machine start
podman system connection ls
- name: Podman Rootful (native)
if: matrix.projects.runner == 'ubuntu-24.04' && (matrix.projects.runtime == 'podman5' || matrix.projects.runtime == 'podman4') && matrix.projects.root == 'rootful'
run: |
podman system connection ls
systemctl disable --now --user podman.socket
sudo systemctl enable --now podman.socket
echo "as a user"
podman info --format '{{.Host.RemoteSocket.Path}}'
echo "as root"
sudo podman info --format '{{.Host.RemoteSocket.Path}}'
export DOCKER_HOST=unix:///run/podman/podman.sock
echo "DOCKER_HOST=unix:///run/podman/podman.sock" >> $GITHUB_ENV
sudo ls -al /run/podman | grep podman.sock
sudo chmod 777 -R /run/podman
sudo ls -al /run/podman | grep podman.sock
- name: Docker Ubuntu
if: matrix.projects.runner == 'ubuntu-24.04' && matrix.projects.runtime == 'docker'
run: |
echo "Configuring Docker for ubuntu"
# Remove the podman, to allow library autodetect to find docker
sudo apt-get remove podman
# Dump info about podman in case we need to report errors
- name: Podman info
if: matrix.projects.runtime == 'podman4' || matrix.projects.runtime == 'podman5'
run: |
echo "Podman information"
podman info
- name: Docker info
if: matrix.projects.runtime == 'docker'
run: |
echo "Docker information"
docker info
# Checkout the project
- name: Checkout
uses: actions/checkout@v4
# Install appropriate level jdk
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.projects.java }}
distribution: 'adopt'
cache: maven
# Install jbang (required to run tests)
- name: Setup jbang (unix)
if: matrix.projects.runner == 'ubuntu-24.04'
run: |
curl -Ls "https://sh.jbang.dev" | bash -s - app setup
# Add jbang to the path for future steps.
echo "$HOME/.jbang/bin" >> $GITHUB_PATH
- name: Setup jbang (win)
if: matrix.projects.runner == 'windows-latest'
run: |
iex "& { $(iwr -useb https://ps.jbang.dev) } app setup"
# Add jbang to the path for future steps.
echo "$HOME\.jbang\bin" >> $GITHUB_PATH
- name: Build library
run: |
./mvnw compile -DskipTests --no-transfer-progress --update-snapshots
./mvnw package -DskipTests --no-transfer-progress --update-snapshots
./mvnw install -DskipTests --no-transfer-progress --update-snapshots
- name: Build test project (win)
if: matrix.projects.runner == 'windows-latest'
run: |
echo "Setting up to build ${{ matrix.projects.project }} with ${{ matrix.projects.java-buildpack-lib-jitpack}} on ${{ matrix.projects.runner }}"
$env:POMVER=(.\mvnw help:evaluate "-Dexpression=project.version" -q -DforceStdout)
$env:CURRENT_WORKFLOW_DEP="dev.snowdrop:buildpack-client:$env:POMVER"
$env:PROJECT_PATH="${{ matrix.projects.project }}"
$env:JDK="${{ matrix.projects.java }}"
echo "Configured to test $env:CURRENT_WORKFLOW_DEP"
echo "Setting up JBang command"
$jbang = ([scriptblock]::Create($(iwr -useb https://ps.jbang.dev)))
echo "Launching JBang"
cd samples/testcases
$jrc=& $jbang run RunTest.java | select -Last 1
echo "After jbang result: $jrc"
exit $jrc
# Build the matrix specificied project with the options configured.
- name: Build test project (unix)
if: matrix.projects.runner == 'ubuntu-24.04'
run: |
echo Setting up to build ${{ matrix.projects.project }} with ${{ matrix.projects.java-buildpack-lib-jitpack}} on ${{ matrix.projects.runner }}
POMVER=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
export CURRENT_WORKFLOW_DEP=dev.snowdrop:buildpack-client:${POMVER}
export PROJECT_PATH=./samples/testcases/${{ matrix.projects.project }}
export JDK=${{ matrix.projects.java }}
export OUTPUT_IMAGE=quay.io/ozzydweller/snowdropbuildtests:daemon.${{ matrix.projects.label }}
chmod +x ./samples/testcases/RunTest.java
./samples/testcases/RunTest.java