-
Notifications
You must be signed in to change notification settings - Fork 47
133 lines (133 loc) · 5.47 KB
/
main.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
name: CI on pull requests.
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- 'docs/**'
env:
LANG: en_US.UTF-8
S2I_URI: https://github.com/openshift/source-to-image/releases/download/v1.3.1/source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz
WILDFLY_S2I_BUILDER_IMAGE: wildfly/wildfly-s2i
WILDFLY_S2I_RUNTIME_IMAGE: wildfly/wildfly-runtime
# The image to copy in docker daemon for testing
UBUNTU_ARCHITECTURE_IMAGE: linuxamd64
BEHAVE_TIMEOUT: 60
jobs:
wfci:
name: Wildfly-s2i Build and Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
jdk: [jdk11, jdk17, jdk21]
steps:
- name: Update hosts - linux
if: matrix.os == 'ubuntu-latest'
run: |
cat /etc/hosts
sudo bash -c "echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > /etc/hosts"
sudo bash -c "echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> /etc/hosts"
sudo sysctl -w fs.file-max=2097152
- uses: actions/checkout@v2
- uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify latest ubi8-minimal
run: |
podman pull registry.access.redhat.com/ubi8/ubi-minimal
podman image ls | grep ubi8
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Setup required system packages
run: |
sudo apt-get update
sudo apt-get install krb5-multidev libkrb5-dev
- name: Setup Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.11.5'
- name: Setup virtualenv and install cekit and required packages
run: |
python --version
sudo pip install virtualenv
mkdir ~/cekit
python3 -m venv ~/cekit
. ~/cekit/bin/activate
pip install cekit docker docker-squash odcs behave lxml packaging
- name: install s2i binary
run: |
echo ===== Installing s2i from ${{ env.S2I_URL }} =====
mkdir /tmp/s2i/ && cd /tmp/s2i/
wget ${{ env.S2I_URI }}
tar xvf source-to-image*.gz
sudo mv s2i /usr/bin
which s2i
s2i version
- name: Build DockerFiles
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
WILDFLY_IMAGE_VERSION=$(yq e ".version" ${{ matrix.jdk }}-overrides.yaml)
cekit build --dry-run --overrides=${{ matrix.jdk }}-overrides.yaml docker
popd
pushd wildfly-runtime-image
cekit build --dry-run --overrides=${{ matrix.jdk }}-overrides.yaml docker
popd
echo "WILDFLY_IMAGE_VERSION=${WILDFLY_IMAGE_VERSION}" >> $GITHUB_ENV
- name: Buildah multi archs Builder Build
id: build_builder_image
uses: redhat-actions/[email protected]
with:
image: ${{ env.WILDFLY_S2I_BUILDER_IMAGE }}
tags: ${{ env.WILDFLY_IMAGE_VERSION }}
context: ./wildfly-builder-image/target/image
platforms: linux/amd64, linux/arm64
containerfiles: |
./wildfly-builder-image/target/image/Dockerfile
- name: Buildah multi archs Runtime Build
id: build_runtime_image
uses: redhat-actions/[email protected]
with:
image: ${{ env.WILDFLY_S2I_RUNTIME_IMAGE }}
tags: ${{ env.WILDFLY_IMAGE_VERSION }}
context: ./wildfly-runtime-image/target/image
platforms: linux/amd64, linux/arm64
containerfiles: |
./wildfly-runtime-image/target/image/Dockerfile
- name: Skopeo copy Builder and Runtime images to Docker local repo for tests
run: |
podman images
skopeo --debug copy containers-storage:localhost/${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }}-${{ env.UBUNTU_ARCHITECTURE_IMAGE }} docker-daemon:${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }}
skopeo --debug copy containers-storage:localhost/${{ env.WILDFLY_S2I_RUNTIME_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }}-${{ env.UBUNTU_ARCHITECTURE_IMAGE }} docker-daemon:${{ env.WILDFLY_S2I_RUNTIME_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }}
- name: List docker images
run: |
docker --version
docker info
docker image ls
docker inspect ${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }}
docker run --rm ${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} bash
- name: Behave Tests
run: |
. ~/cekit/bin/activate
pushd wildfly-builder-image
cekit -v test --image=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}:${{ env.WILDFLY_IMAGE_VERSION }} behave
popd
- name: Additional Tests
run: |
export IMAGE_VERSION=${{ env.WILDFLY_IMAGE_VERSION }}
export IMAGE_NAME=${{ env.WILDFLY_S2I_BUILDER_IMAGE }}
export RUNTIME_IMAGE_NAME=${{ env.WILDFLY_S2I_RUNTIME_IMAGE }}
. ~/cekit/bin/activate
./test/run
- name: Display resources information
if: failure()
run: |
echo === RUNNING CONTAINERS ===
docker container ls
echo === RUNNING PROCESSES ===
top -b -n1
echo === DISK USAGE ===
df -h