Skip to content

Commit 0197080

Browse files
authored
Merge pull request #461 from sclorg/testing_single_versions
Testing single versions for container and openshift tests
2 parents 8de0597 + 10fc5e4 commit 0197080

File tree

2 files changed

+71
-15
lines changed

2 files changed

+71
-15
lines changed

.github/workflows/container-tests.yml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
name: Container-tests by GitHub Action at Testing Farm
2-
31
on:
42
issue_comment:
53
types:
64
- created
75
jobs:
8-
build:
6+
container-tests:
97
# This job only runs for '[test]' pull request comments by owner, member
10-
name: Container-tests by GitHub Action on Testing Farm service
118
runs-on: ubuntu-20.04
9+
name: "Container tests: ${{ matrix.version }} - ${{ matrix.context }}"
1210
strategy:
1311
fail-fast: false
1412
matrix:
13+
version: [ "10", "11", "12", "13" ]
14+
os_test: [ "fedora", "centos7", "rhel7", "rhel8", "rhel9", "c9s", "c8s"]
1515
include:
1616
- tmt_plan: "fedora"
1717
os_test: "fedora"
@@ -33,8 +33,8 @@ jobs:
3333
compose: "RHEL-7.9-Released"
3434
api_key: "TF_INTERNAL_API_KEY"
3535
branch: "master"
36-
tf_scope: "private"
3736
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
37+
tf_scope: "private"
3838
- tmt_plan: "rhel8-docker"
3939
os_test: "rhel8"
4040
context: "RHEL8"
@@ -51,6 +51,14 @@ jobs:
5151
branch: "master"
5252
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
5353
tf_scope: "private"
54+
- tmt_plan: "rhel9-unsubscribed-docker"
55+
os_test: "rhel9"
56+
context: "RHEL9 - Unsubscribed host"
57+
compose: "RHEL-9.0.0-Nightly"
58+
api_key: "TF_INTERNAL_API_KEY"
59+
branch: "master"
60+
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
61+
tf_scope: "private"
5462
- tmt_plan: "c9s"
5563
os_test: "c9s"
5664
context: "CentOS Stream 9"
@@ -65,6 +73,7 @@ jobs:
6573
api_key: "TF_PUBLIC_API_KEY"
6674
branch: "main"
6775
tmt_repo: "https://github.com/sclorg/sclorg-testing-farm"
76+
6877
if: |
6978
github.event.issue.pull_request
7079
&& (contains(github.event.comment.body, '[test]') || contains(github.event.comment.body, '[test-all]'))
@@ -75,15 +84,39 @@ jobs:
7584
with:
7685
ref: "refs/pull/${{ github.event.issue.number }}/head"
7786

87+
- name: Prepare needed variables
88+
shell: bash
89+
id: vars
90+
run: |
91+
dockerfile="Dockerfile.${{ matrix.os_test }}"
92+
if [[ ${{ matrix.os_test }} == "centos7" ]]; then
93+
dockerfile="Dockerfile"
94+
fi
95+
echo "::set-output name=DOCKERFILE_NAME::${dockerfile}"
96+
97+
- name: Check that ${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }} is present
98+
id: check_dockerfile
99+
uses: andstor/file-existence-action@v1
100+
with:
101+
files: "${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }}"
102+
103+
- name: Check that .exclude-${{ matrix.os_test }} file is not present
104+
id: check_exclude_file
105+
uses: andstor/file-existence-action@v1
106+
with:
107+
files: "${{ matrix.version }}/.exclude-${{ matrix.os_test }}"
108+
78109
# https://github.com/sclorg/testing-farm-as-github-action
79-
- name: Schedule tests on external Testing Farm by Testing-Farm-as-github-action
110+
- name: Schedule tests for ${{ matrix.version }} - ${{ matrix.context }}
111+
id: github_action
112+
if: ${{ steps.check_exclude_file.outputs.files_exists == 'false' && steps.check_dockerfile.outputs.files_exists == 'true' }}
80113
uses: sclorg/testing-farm-as-github-action@v1
81114
with:
82115
api_key: ${{ secrets[matrix.api_key] }}
83116
git_url: ${{ matrix.tmt_repo }}
84117
git_ref: ${{ matrix.branch }}
85118
tf_scope: ${{ matrix.tf_scope }}
86119
tmt_plan_regex: ${{ matrix.tmt_plan }}
87-
pull_request_status_name: ${{ matrix.context }}
88-
variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.issue.number }};OS=${{ matrix.os_test }};TEST_NAME=test"
120+
pull_request_status_name: "${{ matrix.context }} - ${{ matrix.version }}"
121+
variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.issue.number }};SINGLE_VERSION=${{ matrix.version }};OS=${{ matrix.os_test }};TEST_NAME=test"
89122
compose: ${{ matrix.compose }}

.github/workflows/openshift-tests.yml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
name: OpenShift tests by GitHub Action at Testing Farm
2-
31
on:
42
issue_comment:
53
types:
64
- created
75
jobs:
8-
build:
6+
openshift-tests:
97
# This job only runs for '[test-all]' or '[test-openshift] pull request comments by owner, member
10-
name: OpenShift tests by GitHub Action on Testing Farm service
8+
name: "OpenShift tests: ${{ matrix.version }} - ${{ matrix.context }}"
119
runs-on: ubuntu-20.04
1210
strategy:
1311
fail-fast: false
1412
matrix:
13+
version: [ "10", "11", "12", "13" ]
14+
os_test: [ "centos7", "rhel7", "rhel8", "rhel9"]
1515
include:
1616
- tmt_plan: "centos7"
1717
os_test: "centos7"
@@ -68,16 +68,39 @@ jobs:
6868
with:
6969
ref: "refs/pull/${{ github.event.issue.number }}/head"
7070

71+
- name: Prepare needed variables
72+
shell: bash
73+
id: vars
74+
run: |
75+
dockerfile="Dockerfile.${{ matrix.os_test }}"
76+
if [[ ${{ matrix.os_test }} == "centos7" ]]; then
77+
dockerfile="Dockerfile"
78+
fi
79+
echo "::set-output name=DOCKERFILE_NAME::${dockerfile}"
80+
81+
- name: Check that ${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }} is present
82+
id: check_dockerfile
83+
uses: andstor/file-existence-action@v1
84+
with:
85+
files: "${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }}"
86+
87+
- name: Check that .exclude-${{ matrix.os_test }} file is not present
88+
id: check_exclude_file
89+
uses: andstor/file-existence-action@v1
90+
with:
91+
files: "${{ matrix.version }}/.exclude-${{ matrix.os_test }}"
92+
7193
# https://github.com/sclorg/testing-farm-as-github-action
72-
- name: Schedule tests on external Testing Farm by Testing-Farm-as-github-action
94+
- name: Schedule tests for ${{ matrix.version }} - ${{ matrix.context }}
7395
id: github_action
96+
if: ${{ steps.check_exclude_file.outputs.files_exists == 'false' && steps.check_dockerfile.outputs.files_exists == 'true' }}
7497
uses: sclorg/testing-farm-as-github-action@v1
7598
with:
7699
api_key: ${{ secrets[matrix.api_key] }}
77100
git_url: ${{ matrix.tmt_repo }}
78101
git_ref: ${{ matrix.branch }}
79102
tf_scope: ${{ matrix.tf_scope }}
80103
tmt_plan_regex: ${{ matrix.tmt_plan }}
81-
pull_request_status_name: ${{ matrix.context }}
82-
variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.issue.number }};OS=${{ matrix.os_test }};TEST_NAME=${{ matrix.test_name }}"
104+
pull_request_status_name: "${{ matrix.context }} - ${{ matrix.version }}"
105+
variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.issue.number }};SINGLE_VERSION=${{ matrix.version }};OS=${{ matrix.os_test }};TEST_NAME=${{ matrix.test_name }}"
83106
compose: ${{ matrix.compose }}

0 commit comments

Comments
 (0)