forked from rockcrafters/chiselled-jre
-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (104 loc) · 3.56 KB
/
tests.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
name: "Chiselled Ubuntu 'jre' Tests"
on:
pull_request:
push:
env:
image-name: ubuntu/jre:test
build-image-name: temurin-jdk8-builder:test
maven-image-name: temurin-jdk8-maven:test
maven-image-base: maven:3.9.0-eclipse-temurin-8
jobs:
build:
runs-on: ubuntu-22.04
name: Build and Test
strategy:
fail-fast: false
matrix:
ubuntu-release: ["22.04"]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '8'
- name: Tests Maven cache
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Tests PDFBox
uses: actions/cache@v4
with:
path: tests/pdfbox/pdfbox
key: tests-pdfbox-test-pdbbox
restore-keys: |
tests-pdfbox-test-pdbbox
- name: Tests Petclinic
uses: actions/cache@v4
with:
path: tests/petclinic-test/spring-petclinic
key: tests-petclinic-test-spring-petclinic
restore-keys: |
tests-petclinic-test-spring-petclinic
- name: Build the jre image
run: |
docker build \
-t ${{ env.image-name }} \
--build-arg UID=$(id -u ${USER}) \
--build-arg GID=$(id -g ${USER}) \
-f jre/Dockerfile.${{ matrix.ubuntu-release }} \
jre
- name: Build the JDK docker image
run: |
docker build \
-t ${{ env.build-image-name }} \
--build-arg UID=$(id -u ${USER}) \
--build-arg GID=$(id -g ${USER}) \
-f tests/containers/builder/Dockerfile.${{ matrix.ubuntu-release }} \
tests/containers/builder
- name: Build Maven docker image
run: |
docker build \
-t ${{ env.maven-image-name }} \
--build-arg UID=$(id -u ${USER}) \
--build-arg GID=$(id -g ${USER}) \
--build-arg BASE_IMAGE=${{ env.image-name }} \
--build-arg MAVEN_IMAGE=${{ env.maven-image-base }} \
-f tests/containers/maven/Dockerfile.${{ matrix.ubuntu-release }} \
tests/containers/maven
- name: Run Tests
working-directory: ${{ github.workspace }}/tests/
run: |
./run-all-tests ${{ env.image-name }} \
${{ env.build-image-name }} \
${{ runner.temp }}/.m2 \
${{ env.maven-image-name }}
multi-arch-build:
runs-on: ubuntu-22.04
name: Multi Architecture Build
strategy:
fail-fast: false
matrix:
ubuntu-release: ["22.04"]
arch: ["amd64", "arm64"]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Lint the Dockerfiles
- name: Lint the Dockerfile
uses: hadolint/[email protected]
with:
dockerfile: jre/Dockerfile.${{ matrix.ubuntu-release }}
ignore: DL3008,DL3015,SC3028
- name: Build the jre image
run: |
docker buildx build \
--tag=${{ env.image-name }} \
--file=jre/Dockerfile.${{ matrix.ubuntu-release }} \
--platform=linux/${{ matrix.arch }} \
jre