-
Notifications
You must be signed in to change notification settings - Fork 42
95 lines (91 loc) · 3.9 KB
/
container-tests.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
name: Container-tests by GitHub Action at Testing Farm
on:
issue_comment:
types:
- created
jobs:
build:
# This job only runs for '[test]' pull request comments by owner, member
name: Container-tests by GitHub Action on Testing Farm service
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
container-to-test: ["postgresql-container", "nginx-container", "s2i-perl-container", "s2i-python-container", "s2i-base-container" ]
os: ["fedora", "c9s", "rhel8", "rhel9", "c10s", "rhel10"]
if: |
github.event.issue.pull_request
&& (contains(github.event.comment.body, '[test]') || contains(github.event.comment.body, '[test-all]'))
&& contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association)
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: "refs/pull/${{ github.event.issue.number }}/head"
- name: Set variables for Testing Farm
id: vars
run: |
api_key=${{ secrets.TF_INTERNAL_API_KEY }}
branch="master"
tf_scope="private"
tmt_repo="https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
if [ "${{ matrix.os }}" == "fedora" ] || [ "${{ matrix.os }}" == "c9s" ] || [ "${{ matrix.os }}" == "c10s" ]; then
api_key=${{ secrets.TF_PUBLIC_API_KEY }}
branch="main"
tf_scope="public"
tmt_repo="https://github.com/sclorg/sclorg-testing-farm"
if [ "${{ matrix.os }}" == "fedora" ]; then
compose="Fedora-latest"
context="Fedora"
tmt_plan="fedora$"
else
if [ "${{ matrix.os }}" == "c9s" ]; then
compose="CentOS-Stream-9"
context="CentOS Stream 9"
tmt_plan="c9s$"
else
compose="CentOS-Stream-10"
context="CentOS Stream 10"
tmt_plan="c10s$"
fi
fi
else
if [ "${{ matrix.os }}" == "rhel8" ]; then
compose="RHEL-8.10.0-Nightly"
context="RHEL8"
tmt_plan="rhel8-docker$"
else
if [ "${{ matrix.os }}" == "rhel9" ]; then
compose="RHEL-9.4.0-Nightly"
context="RHEL9"
tmt_plan="rhel9-docker$"
else
compose="RHEL-10-Nightly"
context="RHEL10"
tmt_plan="rhel10-docker$"
fi
fi
fi
echo "api_key=$api_key" >> "$GITHUB_OUTPUT"
echo "branch=$branch" >> "$GITHUB_OUTPUT"
echo "tf_scope=$tf_scope" >> "$GITHUB_OUTPUT"
echo "tmt_repo=$tmt_repo" >> "$GITHUB_OUTPUT"
echo "compose=$compose" >> "$GITHUB_OUTPUT"
echo "context=$context" >> "$GITHUB_OUTPUT"
echo "tmt_plan=$tmt_plan" >> "$GITHUB_OUTPUT"
shell: bash
# https://github.com/sclorg/testing-farm-as-github-action
- name: Schedule tests on external Testing Farm by Testing-Farm-as-github-action
id: github_action
uses: sclorg/testing-farm-as-github-action@main
with:
api_key: ${{ steps.vars.outputs.api_key }}
git_url: ${{ steps.vars.outputs.tmt_repo }}
git_ref: ${{ steps.vars.outputs.branch }}
tf_scope: ${{ steps.vars.outputs.tf_scope }}
tmt_plan_regex: ${{ steps.vars.outputs.tmt_plan }}
update_pull_request_status: true
create_issue_comment: true
pull_request_status_name: "${{ steps.vars.outputs.context }} - ${{ matrix.container-to-test }}"
variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.issue.number }};OS=${{ matrix.os }};TEST_NAME=test;TESTED_IMAGE=${{ matrix.container-to-test }}"
compose: ${{ steps.vars.outputs.compose }}