Skip to content

Commit 484dbbe

Browse files
authored
Merge pull request #364 from jmtd/ubi9-gha-simplify
Simpify GHA configuration (ubi9)
2 parents f198e83 + 4f2d798 commit 484dbbe

File tree

5 files changed

+54
-152
lines changed

5 files changed

+54
-152
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: UBI9 OpenJDK S2I Image CI template
2+
on:
3+
workflow_call:
4+
inputs:
5+
image:
6+
required: true
7+
type: string
8+
env:
9+
LANG: en_US.UTF-8
10+
jobs:
11+
openjdkci:
12+
name: OpenJDK S2I Build and Test
13+
runs-on: ubuntu-20.04
14+
strategy:
15+
fail-fast: false
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Verify latest UBI image is present
19+
run: docker pull registry.access.redhat.com/ubi9/ubi-minimal:latest
20+
21+
- name: Install CEKit
22+
uses: cekit/[email protected]
23+
24+
- name: Build
25+
run: |
26+
cekit -v --descriptor ${{ inputs.image }}.yaml build docker --no-squash
27+
28+
- name: Install and cache S2I CLI tool from GitHub
29+
uses: redhat-actions/openshift-tools-installer@v1
30+
with:
31+
source: "github"
32+
github_pat: ${{ github.token }}
33+
s2i: "1.3.4"
34+
35+
- name: Behave Tests
36+
run: |
37+
echo /home/runner/work/_temp/openshift-bin >> $GITHUB_PATH
38+
cekit -v --descriptor ${{ inputs.image }}.yaml test behave

.github/workflows/ubi9-openjdk-11-runtime.yml

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,9 @@ name: UBI9 OpenJDK 11 Runtime S2I Image CI
22
on: [push, pull_request]
33
env:
44
LANG: en_US.UTF-8
5-
CEKIT_VERSION: 4.6.0
6-
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
75
IMAGE: ubi9-openjdk-11-runtime
86
jobs:
9-
openjdkci:
10-
name: OpenJDK S2I Build and Test
11-
runs-on: ubuntu-20.04
12-
strategy:
13-
fail-fast: false
14-
steps:
15-
- uses: actions/checkout@v2
16-
- name: Verify latest UBI image is present
17-
run: docker pull registry.access.redhat.com/ubi9/ubi-minimal:latest
18-
- name: Setup required system packages
19-
run: |
20-
sudo apt-get update
21-
sudo apt-get install -y virtualenv libkrb5-dev
22-
- name: Setup virtualenv and install cekit and required packages
23-
run: |
24-
mkdir ~/cekit${{ env.CEKIT_VERSION }}
25-
virtualenv -p python3 ~/cekit${{ env.CEKIT_VERSION }}
26-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
27-
pip3 install cekit==${{ env.CEKIT_VERSION }} docker docker-squash odcs behave lxml
28-
- name: Build
29-
run: |
30-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
31-
cekit -v --descriptor ${{ env.IMAGE }}.yaml build docker
32-
- name: install s2i binary
33-
run: |
34-
echo ===== Installing s2i from ${{ env.S2I_URL }} =====
35-
mkdir /tmp/s2i/ && cd /tmp/s2i/
36-
wget ${{ env.S2I_URI }}
37-
tar xvf source-to-image*.gz
38-
sudo mv s2i /usr/bin
39-
which s2i
40-
s2i version
41-
- name: Behave Tests
42-
run: |
43-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
44-
cekit -v --descriptor ${{ env.IMAGE }}.yaml test behave
7+
call-openjdkci:
8+
uses: ./.github/workflows/image-workflow-template.yml
9+
with:
10+
image: ubi9-openjdk-17

.github/workflows/ubi9-openjdk-11.yml

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,9 @@ name: UBI9 OpenJDK 11 S2I Image CI
22
on: [push, pull_request]
33
env:
44
LANG: en_US.UTF-8
5-
CEKIT_VERSION: 4.6.0
6-
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
75
IMAGE: ubi9-openjdk-11
86
jobs:
9-
openjdkci:
10-
name: OpenJDK S2I Build and Test
11-
runs-on: ubuntu-20.04
12-
strategy:
13-
fail-fast: false
14-
steps:
15-
- uses: actions/checkout@v2
16-
- name: Verify latest UBI image is present
17-
run: docker pull registry.access.redhat.com/ubi9/ubi-minimal:latest
18-
- name: Setup required system packages
19-
run: |
20-
sudo apt-get update
21-
sudo apt-get install -y virtualenv libkrb5-dev
22-
- name: Setup virtualenv and install cekit and required packages
23-
run: |
24-
mkdir ~/cekit${{ env.CEKIT_VERSION }}
25-
virtualenv -p python3 ~/cekit${{ env.CEKIT_VERSION }}
26-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
27-
pip3 install cekit==${{ env.CEKIT_VERSION }} docker docker-squash odcs behave lxml
28-
- name: Build
29-
run: |
30-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
31-
cekit -v --descriptor ${{ env.IMAGE }}.yaml build docker
32-
- name: install s2i binary
33-
run: |
34-
echo ===== Installing s2i from ${{ env.S2I_URL }} =====
35-
mkdir /tmp/s2i/ && cd /tmp/s2i/
36-
wget ${{ env.S2I_URI }}
37-
tar xvf source-to-image*.gz
38-
sudo mv s2i /usr/bin
39-
which s2i
40-
s2i version
41-
- name: Behave Tests
42-
run: |
43-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
44-
cekit -v --descriptor ${{ env.IMAGE }}.yaml test behave
7+
call-openjdkci:
8+
uses: ./.github/workflows/image-workflow-template.yml
9+
with:
10+
image: ubi9-openjdk-17

.github/workflows/ubi9-openjdk-17-runtime.yml

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,9 @@ name: UBI9 OpenJDK 17 Runtime S2I Image CI
22
on: [push, pull_request]
33
env:
44
LANG: en_US.UTF-8
5-
CEKIT_VERSION: 4.6.0
6-
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
75
IMAGE: ubi9-openjdk-17-runtime
86
jobs:
9-
openjdkci:
10-
name: OpenJDK S2I Build and Test
11-
runs-on: ubuntu-20.04
12-
strategy:
13-
fail-fast: false
14-
steps:
15-
- uses: actions/checkout@v2
16-
- name: Verify latest UBI image is present
17-
run: docker pull registry.access.redhat.com/ubi9/ubi-minimal:latest
18-
- name: Setup required system packages
19-
run: |
20-
sudo apt-get update
21-
sudo apt-get install -y virtualenv libkrb5-dev
22-
- name: Setup virtualenv and install cekit and required packages
23-
run: |
24-
mkdir ~/cekit${{ env.CEKIT_VERSION }}
25-
virtualenv -p python3 ~/cekit${{ env.CEKIT_VERSION }}
26-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
27-
pip3 install cekit==${{ env.CEKIT_VERSION }} docker docker-squash odcs behave lxml
28-
- name: Build
29-
run: |
30-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
31-
cekit -v --descriptor ${{ env.IMAGE }}.yaml build docker
32-
- name: install s2i binary
33-
run: |
34-
echo ===== Installing s2i from ${{ env.S2I_URL }} =====
35-
mkdir /tmp/s2i/ && cd /tmp/s2i/
36-
wget ${{ env.S2I_URI }}
37-
tar xvf source-to-image*.gz
38-
sudo mv s2i /usr/bin
39-
which s2i
40-
s2i version
41-
- name: Behave Tests
42-
run: |
43-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
44-
cekit -v --descriptor ${{ env.IMAGE }}.yaml test behave
7+
call-openjdkci:
8+
uses: ./.github/workflows/image-workflow-template.yml
9+
with:
10+
image: ubi9-openjdk-17

.github/workflows/ubi9-openjdk-17.yml

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,9 @@ name: UBI9 OpenJDK 17 S2I Image CI
22
on: [push, pull_request]
33
env:
44
LANG: en_US.UTF-8
5-
CEKIT_VERSION: 4.6.0
6-
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
75
IMAGE: ubi9-openjdk-17
86
jobs:
9-
openjdkci:
10-
name: OpenJDK S2I Build and Test
11-
runs-on: ubuntu-20.04
12-
strategy:
13-
fail-fast: false
14-
steps:
15-
- uses: actions/checkout@v2
16-
- name: Verify latest UBI image is present
17-
run: docker pull registry.access.redhat.com/ubi9/ubi-minimal:latest
18-
- name: Setup required system packages
19-
run: |
20-
sudo apt-get update
21-
sudo apt-get install -y virtualenv libkrb5-dev
22-
- name: Setup virtualenv and install cekit and required packages
23-
run: |
24-
mkdir ~/cekit${{ env.CEKIT_VERSION }}
25-
virtualenv -p python3 ~/cekit${{ env.CEKIT_VERSION }}
26-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
27-
pip3 install cekit==${{ env.CEKIT_VERSION }} docker docker-squash odcs behave lxml
28-
- name: Build
29-
run: |
30-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
31-
cekit -v --descriptor ${{ env.IMAGE }}.yaml build docker
32-
- name: install s2i binary
33-
run: |
34-
echo ===== Installing s2i from ${{ env.S2I_URL }} =====
35-
mkdir /tmp/s2i/ && cd /tmp/s2i/
36-
wget ${{ env.S2I_URI }}
37-
tar xvf source-to-image*.gz
38-
sudo mv s2i /usr/bin
39-
which s2i
40-
s2i version
41-
- name: Behave Tests
42-
run: |
43-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
44-
cekit -v --descriptor ${{ env.IMAGE }}.yaml test behave
7+
call-openjdkci:
8+
uses: ./.github/workflows/image-workflow-template.yml
9+
with:
10+
image: ubi9-openjdk-17

0 commit comments

Comments
 (0)