-
Notifications
You must be signed in to change notification settings - Fork 414
141 lines (137 loc) · 5.09 KB
/
integration-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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Integration test suite
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
container-build-cache:
name: Docker Buildx cache
runs-on: ubuntu-latest
strategy:
matrix:
scenario:
# - 'debian-12-jar'
# - 'debian-12-mvn'
- debian-12-tomcat-war-systemd
image: [ ubuntu-latest ]
include:
# - scenario: debian-12-jar
# build_command: -bjm ${{ needs.prepare_environment.outputs.test_image_name }}-jar
# - scenario: debian-12-mvn
# build_command: -bjm ${{ needs.prepare_environment.outputs.test_image_name }}-mvn
- scenario: debian-12-tomcat-war-systemd
CONTAINER_CACHE: integration-build-war.tar
CONTAINER_IMAGE: local/integration-build-war:latest
BUILD_COMMAND: ./.integration-scenarios/debian-12-tomcat-war-systemd/run.sh -i local/integration-build-war:latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Cache the docker image
uses: actions/cache@v4
with:
path: ${{ matrix.CONTAINER_CACHE }}
key: ${{ runner.os }}-tomcat-test-${{ matrix.CONTAINER_IMAGE }}
restore-keys: |
${{ runner.os }}-tomcat-test-
- name: Load the docker image from cache if available
run: |
if [ -f ${{ matrix.CONTAINER_CACHE }} ]; then
podman load -i ${{ matrix.CONTAINER_CACHE }} || echo "Could not load the image from cache. Building it."
fi
- name: Build the podman image for changes
run: |
echo "Building the podman image ${{ matrix.BUILD_COMMAND }}"
bash ${{ matrix.BUILD_COMMAND }}
- name: Export the podman image again
run: |
podman save -o ${{ matrix.CONTAINER_CACHE }} ${{ matrix.CONTAINER_IMAGE }}
scenario-debian-12-tomcat-war-systemd:
name: Run Debian 12 Tomcat WAR systemd integration tests
runs-on: ubuntu-latest
needs:
- container-build-cache
strategy:
matrix:
test_case: [ '0_*.sh', '1_*.sh', '2_*.sh' ]
image: [ ubuntu-latest ]
env:
CONTAINER_CACHE: integration-build-war.tar
CONTAINER_IMAGE: local/integration-build-war:latest
BUILD_COMMAND: ./.integration-scenarios/debian-12-tomcat-war-systemd/run.sh -i local/integration-build-war:latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Cache the docker image
uses: actions/cache@v4
with:
path: ${{ env.CONTAINER_CACHE }}
key: ${{ runner.os }}-tomcat-test-${{ env.CONTAINER_IMAGE }}
restore-keys: |
${{ runner.os }}-tomcat-test-
- name: Load the docker image from cache if available
run: |
if [ -f ${{ env.CONTAINER_CACHE }} ]; then
podman load -i ${{ env.CONTAINER_CACHE }} || { echo "Could not load the image from cache."; exit 1; }
fi
- name: Run integration tests
run: ./.integration-scenarios/debian-12-tomcat-war-systemd/run.sh -t -g '${{ matrix.test_case }}' -i ${{ env.CONTAINER_IMAGE }}
# debian-12-jar-mvn-run-tests:
# needs:
# - prepare_environment
# - container-build-cache
# name: Run Debian 12 Maven JAR integration tests
# runs-on: ubuntu-latest
# strategy:
# matrix:
# runtype: [ '-m' , '-j' ]
# testgroup: [ build*car*, build*public*, arg-overrides*, check*, lookup-yml*, missing-config*, specify-yml* ]
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# id: buildx
# with:
# install: true
# - name: Cache Maven packages
# uses: actions/cache@v4
# with:
# path: ~/.m2
# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
# restore-keys: ${{ runner.os }}-m2
# - name: Run test group with run type
# run: |
# echo "Scenario: ${{ matrix.scenario }}"
# echo "Parameters: ${{ matrix.parameters }}"
# .integration-scenarios/debian-12-jar-mvn/run.sh -b ${{ matrix.runtype }} -t ${{ matrix.testgroup }}