Skip to content

Commit 23c9250

Browse files
committed
Simplify GHA (part 1): use Actions for cekit and s2i
Signed-off-by: Jonathan Dowland <[email protected]>
1 parent f198e83 commit 23c9250

File tree

4 files changed

+52
-92
lines changed

4 files changed

+52
-92
lines changed

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

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ 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:
97
openjdkci:
@@ -15,30 +13,22 @@ jobs:
1513
- uses: actions/checkout@v2
1614
- name: Verify latest UBI image is present
1715
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
16+
17+
- name: Install CEKit
18+
uses: cekit/[email protected]
19+
2820
- name: Build
2921
run: |
30-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
3122
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
23+
24+
- name: Install and cache S2I CLI tool from GitHub
25+
uses: redhat-actions/openshift-tools-installer@v1
26+
with:
27+
source: "github"
28+
github_pat: ${{ github.token }}
29+
s2i: "1.3.6"
30+
4131
- name: Behave Tests
4232
run: |
43-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
33+
echo /home/runner/work/_temp/openshift-bin >> $GITHUB_PATH
4434
cekit -v --descriptor ${{ env.IMAGE }}.yaml test behave

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

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ 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:
97
openjdkci:
@@ -15,30 +13,22 @@ jobs:
1513
- uses: actions/checkout@v2
1614
- name: Verify latest UBI image is present
1715
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
16+
17+
- name: Install CEKit
18+
uses: cekit/[email protected]
19+
2820
- name: Build
2921
run: |
30-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
3122
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
23+
24+
- name: Install and cache S2I CLI tool from GitHub
25+
uses: redhat-actions/openshift-tools-installer@v1
26+
with:
27+
source: "github"
28+
github_pat: ${{ github.token }}
29+
s2i: "1.3.6"
30+
4131
- name: Behave Tests
4232
run: |
43-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
33+
echo /home/runner/work/_temp/openshift-bin >> $GITHUB_PATH
4434
cekit -v --descriptor ${{ env.IMAGE }}.yaml test behave

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

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ 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:
97
openjdkci:
@@ -15,30 +13,22 @@ jobs:
1513
- uses: actions/checkout@v2
1614
- name: Verify latest UBI image is present
1715
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
16+
17+
- name: Install CEKit
18+
uses: cekit/[email protected]
19+
2820
- name: Build
2921
run: |
30-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
3122
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
23+
24+
- name: Install and cache S2I CLI tool from GitHub
25+
uses: redhat-actions/openshift-tools-installer@v1
26+
with:
27+
source: "github"
28+
github_pat: ${{ github.token }}
29+
s2i: "1.3.6"
30+
4131
- name: Behave Tests
4232
run: |
43-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
33+
echo /home/runner/work/_temp/openshift-bin >> $GITHUB_PATH
4434
cekit -v --descriptor ${{ env.IMAGE }}.yaml test behave

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

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ 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:
97
openjdkci:
@@ -15,30 +13,22 @@ jobs:
1513
- uses: actions/checkout@v2
1614
- name: Verify latest UBI image is present
1715
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
16+
17+
- name: Install CEKit
18+
uses: cekit/[email protected]
19+
2820
- name: Build
2921
run: |
30-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
3122
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
23+
24+
- name: Install and cache S2I CLI tool from GitHub
25+
uses: redhat-actions/openshift-tools-installer@v1
26+
with:
27+
source: "github"
28+
github_pat: ${{ github.token }}
29+
s2i: "1.3.6"
30+
4131
- name: Behave Tests
4232
run: |
43-
. ~/cekit${{ env.CEKIT_VERSION }}/bin/activate
33+
echo /home/runner/work/_temp/openshift-bin >> $GITHUB_PATH
4434
cekit -v --descriptor ${{ env.IMAGE }}.yaml test behave

0 commit comments

Comments
 (0)