-
Notifications
You must be signed in to change notification settings - Fork 327
151 lines (141 loc) · 5.61 KB
/
container-tests.yml
File metadata and controls
151 lines (141 loc) · 5.61 KB
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
142
143
144
145
146
147
148
149
150
151
name: Container tests
on:
pull_request:
branches:
- 'master'
jobs:
distgen-check:
name: "Check distgen generated files"
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: true
- name: Check distgen generated files
id: check
shell: bash
run: |
sha=$(git rev-parse HEAD)
sudo apt update && sudo apt -y install python3-pip
pip3 install pyyaml distgen Jinja2
result="success"
./common/tests/check_distgen_generated_files.sh || result="failure"
echo "result=$result" >> "$GITHUB_OUTPUT"
echo "sha=$sha" >> "$GITHUB_OUTPUT"
- name: Set final commit status
uses: myrotvorets/set-commit-status-action@1.1.5
with:
status: ${{ steps.check.outputs.result }}
context: "Distgen check"
sha: ${{ steps.check.outputs.sha }}
- name: Exit on ERR
shell: bash
run: |
_result=${{ steps.check.outputs.result }}
if [ "$_result" == failure ]; then
echo "Distgen-generated files are not regenerated properly."
echo "Please regenerate them with:"
echo "'make clean-versions'"
echo "'make generate-all'"
exit 1
fi
container-tests:
needs: distgen-check
name: "Container tests: ${{ matrix.version }} - ${{ matrix.context }}"
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
version: [ "2.7", "3.8", "3.9", "3.9-minimal", "3.10", "3.11" ]
os_test: [ "fedora", "centos7", "rhel7", "rhel8", "rhel9", "c9s"]
include:
- tmt_plan: "fedora"
os_test: "fedora"
context: "Fedora"
compose: "Fedora-latest"
api_key: "TF_PUBLIC_API_KEY"
branch: "main"
tmt_repo: "https://github.com/sclorg/sclorg-testing-farm"
- tmt_plan: "centos7"
os_test: "centos7"
context: "CentOS7"
compose: "CentOS-7"
api_key: "TF_PUBLIC_API_KEY"
branch: "main"
tmt_repo: "https://github.com/sclorg/sclorg-testing-farm"
- tmt_plan: "rhel7-docker"
os_test: "rhel7"
context: "RHEL7"
compose: "RHEL-7.9-Released"
api_key: "TF_INTERNAL_API_KEY"
branch: "master"
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
tf_scope: "private"
- tmt_plan: "rhel8-docker"
os_test: "rhel8"
context: "RHEL8"
compose: "RHEL-8.6.0-Nightly"
api_key: "TF_INTERNAL_API_KEY"
branch: "master"
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
tf_scope: "private"
- tmt_plan: "rhel9-docker"
os_test: "rhel9"
context: "RHEL9"
compose: "RHEL-9.1.0-Nightly"
api_key: "TF_INTERNAL_API_KEY"
branch: "master"
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
tf_scope: "private"
- tmt_plan: "rhel9-unsubscribed-docker"
os_test: "rhel9"
context: "RHEL9 - Unsubscribed host"
compose: "RHEL-9.1.0-Nightly"
api_key: "TF_INTERNAL_API_KEY"
branch: "master"
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
tf_scope: "private"
- tmt_plan: "c9s"
os_test: "c9s"
context: "CentOS Stream 9"
compose: "CentOS-Stream-9"
api_key: "TF_PUBLIC_API_KEY"
branch: "main"
tmt_repo: "https://github.com/sclorg/sclorg-testing-farm"
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Prepare needed variables
shell: bash
id: vars
run: |
dockerfile="Dockerfile.${{ matrix.os_test }}"
if [[ ${{ matrix.os_test }} == "centos7" ]]; then
dockerfile="Dockerfile"
fi
echo "::set-output name=DOCKERFILE_NAME::${dockerfile}"
- name: Check if ${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }} is present
id: check_dockerfile
uses: andstor/file-existence-action@v1
with:
files: "${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }}"
- name: Check if .exclude-${{ matrix.os_test }} file is present
id: check_exclude_file
uses: andstor/file-existence-action@v1
with:
files: "${{ matrix.version }}/.exclude-${{ matrix.os_test }}"
# https://github.com/sclorg/testing-farm-as-github-action
- name: Schedule tests for ${{ matrix.version }} - ${{ matrix.context }}
if: ${{ steps.check_exclude_file.outputs.files_exists == 'false' && steps.check_dockerfile.outputs.files_exists == 'true' }}
id: github_action
uses: sclorg/testing-farm-as-github-action@v1
with:
api_key: ${{ secrets[matrix.api_key] }}
git_url: ${{ matrix.tmt_repo }}
git_ref: ${{ matrix.branch }}
tf_scope: ${{ matrix.tf_scope }}
tmt_plan_regex: ${{ matrix.tmt_plan }}
pull_request_status_name: "${{ matrix.context }} - ${{ matrix.version }}"
variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.number }};SINGLE_VERSION=${{ matrix.version }};OS=${{ matrix.os_test }};TEST_NAME=test"
compose: ${{ matrix.compose }}